i have written simple programs use'n bash for many years
i most always use something like
false
if (($? != 0)); then echo failed; fi
other than readability what is the difference in the above and
false || echo failed
I would test the command directly:
if ! false ## or whatever you are actually testing
then
echo failed
fi
--
Chris F.A. Johnson <http://cfajohnson.com/>
=========================== Author: ===============================
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux shell (2009, Apress)