I have a Bash script that runs 3 commands. The last file is called "junk1.txt" which I am worrying about. I want to make an addition to the check the if statement performs. If the "junk1.txt" is an ASCII text file. How would I go about doing this?
./command1 > command1.txt
while read l;
do
command2 > command2.txt
while read m;
do
command3 junk.txt > junk1.txt 2>/tmp/err
if [ -s /tmp/err ] #I WANT TO ADD ANOTHER CONDITION HERE
then
echo "not cracked"
else
echo "cracked"
exit
fi
done < command2.txt
done < command1.txt