How to find the return value of last executed command in UNIX?

unix

Solution

You can use the shell variable `$?`

Such as:

$ true ; echo $?
0
$ false ; echo $?
1

Problem

How to find the return value of last executed command in UNIX?

Original source