Condition Evaluation Utility
After you run a command in UNIX shell (bourne, bash, etc), $? has the exit code (return value) of the prior run command: $? Expands to the exit status of the most recent pipeline. Shell scripting is a bit weird in that the return value of a program is evaluated as true if it’s 0 and false if it’s non-zero. This is useful as by convention unix commands return 0 on success or any other integer code to map to specific error conditions. ...