How to find the return value of last executed command in UNIX?
+6
A:
You can use the shell valiable "$?"
(without the quotes, of course).
Such as:
ghostdog$ true ; echo $?
0
ghostdog$ false ; echo $?
1
ghostdog74
2009-07-14 05:54:48
The answer includes the question mark.
GreenReign
2009-07-14 05:57:12
Clarified, added an example and upvoted.
paxdiablo
2009-07-14 06:17:31