Post by Angel TsankovHow can I most easily and most safely set the value of $? to
non-zero?
Run a command that will fail, e.g., any one of:
false
[ $1 -eq 2 ]
[ x = "" ]
grep '^root:@@@:' /etc/passwd
find -name a b 2>/dev/null
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence