Why my code isn't outputting if a string entered isn't in the file. When I enter a string and it isn't in the file, there's no response back, it re-loops back to the beginning. Can someone tell me what's wrong with my code?
while :
do
echo "Please enter a string"
read input_string
echo "Please enter the file name too see if that string is present in it - (Enter .abw after)"
read input_string1
if grep -q $input_string $input_string1 ; then
echo "Your string has been found"
fi
done
input_string
isn't really a speaking variable name, by the way :) – Marian Sep 22 '14 at 17:12