I'm trying to loop source ./a.sh
in the code below so that I can try all the possible pincodes for another bash file, how do I do that?
this is my current code:
#!/bin/bash
touch output.txt
for pincode in {0000..9999}; do
echo "$pincode" | source ./a.sh > output.txt
done
I'm trying to add a while loop here but I don't know how, I also tried the following code:
#!/bin/bash
touch output.txt
for pincode in {0000..9999}; do
echo "$pincode"
done | source ./a.sh
but again, I couldn't get the source ./a.sh
to loop(im a beginner)