Meaning of $? (dollar question mark) in shell scripts

This is the exit status of the last executed command. For example the command true always returns a status of 0 and false always returns a status of 1: From the manual: (acessible by calling man bash in your shell) $?       Expands to the exit status of the most recently executed foreground pipeline. By convention an exit status of 0 means success, and non-zero return status … Read more