echo -n "Try to guess the answer " read ans if [ $ans -lt 42 ] then echo "No, too low" elif [ $ans -gt 42 ] then echo "No, too high" else echo "Ah, the ultimate answer!" fi
The elif and else sections are optional. Hint: make sure you leave spaces between all tokens e.g. don't code e.g.:-
if [$ans -lt 42]