You have to check the command's exit status. . .
A simple way (simple minded too) is to do the following:
Code:
[ 33 -eq 33 ] && echo boo
[ 33 -eq 34 ] && echo boo
Since && only evaluates the second command if the first's exit status is 0 (33 = 33 is true => exit(0)).
There are better ways of checking, but I'm too tired to look through my scripts. . .
I'm an idiot, a very tired idiot, but still an idiot.
Code:
if [ 33 -eq 34 ]; then echo "boo"; fi
If you want strings, use "=" instead of "-eq", of course.