$?
is the return code from the last run process. 0 means no error happened. Other values represent some kind of unusual condition.
Values 128 and above usually represent some kind of signal. 147 - 128 = 19, which means the program received signal 19 (SIGSTOP
on Linux). Now, normally pressing ^Z sends SIGTSTP
(a different signal from SIGSTOP
), which probably meant that top
caught that signal, did some (probably terminal-related) cleanup, and reissued SIGSTOP
to actually suspend the program.
top
also caught SIGINT
(which is normally issued after pressing ^C), to do cleanup and exit cleanly (with exit value 0).
You can run kill -l
to see what all the signal numbers are for the current platform. Note that the numbers are different for different platforms; for example, SIGSTOP
is 17 on Darwin and 19 on Linux.