Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

check exit code



I want to check exit code of some command through the $? variable
(putting command into 'if' statement is not acceptable).
I found currently two ways to do so:
if (( $? == 0 )); then; echo true; else; echo false; fi
if  ( exit $? ) ; then; echo true; else; echo false; fi

Neither of them seems to be elegant. Maybe there is a builtin which takes
number as argument and returns it? Or what would you suggest?

-- 
Roman I. Cheplyaka
http://ro-che.info/

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author