Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Return value when SIGTSTP'ing

    Hi all :)

    When I hit ^Z to stop a process, the $? variable holds the value
19 or 20, depending on the program being stopped (that is, if the
program handles or not SIGTSTP, I suppose), instead of 128+19 and
128+20, as I assumed from the docs.

    Well, strictly speaking the process is not terminated, so maybe
the 128+signal number rule doesn't apply here, but since $? holds the
signal number, I think that it would be a good idea. I don't know
what POSIX specifies (or SUS), or what the other shells do, anyway.

    Is there any reason to set the exitcode to the signal number and
not 128+signal number instead?

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

Messages sorted by: Reverse Date, Date, Thread, Author