If the return value of a command is greater than 128, it means that the command is terminated by signal

If the return value of a command is greater than 128, it means that the command is terminated by signal.

$ man bash
The return value of a simple command is its exit status, or 128+n if the command is terminated by signal n.

Example:

$ some_command
$ echo $?
139

In the above example, the return value is 139. Because 139=128+11 it means that the command was terminated by signal 11.
See `man signal` and you will find that signal 11 is SIGSEGV and it means segmentation violation.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.