So Here is What i am trying to make first if possible a way to get an if statement from a file and then look at what would be an input that would be true and generate that valid input here is what i have come up with so far this is the test file first A.K.A Test.sh oh btw a Valid input example is 1file and then the other number/letters are just optional
input=
if [[ $input = [0-9]@(|[0-9]@(|[0-9]))File@(|[0-9]@(|[0-9]@(|[0-9]@(|[a-z]@(|[a-z]@(|[a-z])))))) ]]; then
echo "Good"
else
echo "Bad"
fi
Then what the actual code What i will call the input generator so currently what is does is it counts how many numbers there are or could be in the sequence however from there I don't know what i should do to make this actually generate a valid input now i don't need it to read a the test file I'm fine with it being in the same file as the test with the sequence
file=test.sh
N="\[0-9]"
Al='\[a-z]'
Au='\[A-Z]'
ifstat=$(grep -w if $file)
amn=$(echo "$ifstat" | grep -o "$N" | wc -l)
echo "$amn"
so in summary i want it a generator to make a random input for that if statement that would be "Good"
Aucun commentaire:
Enregistrer un commentaire