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

zsh exit status



I should now be subscribed to this list.  Hopefully.  With a following
wind and stuff ...

When zsh exits, it returns the exit code of the last process to exit.
Which is correct.  However, when the last process exited on a signal, it
returns the full status back.
zsh% zsh
[2]zsh% sleep 5
^C
[2]{SIGINT}zsh% ^D
{SIGINT}zsh% print $ZSH_VERSION
3.1.4
zsh% 

How valid is this?  Is this an ambiguous area?  Personally, if a
process exits with a signal status, I expect the signal to have been in
that process.  Should zsh be passing the exit status no matter the
value, or should it map signals to some other value?

I've checked, and both bash and pdksh also pass this unchanged.  Is
this behaviour mandated by any standards?

Thanks.  (Checking the other shells has just reminded me that only zsh
seems to be the only shell with a ternary operator for prompts, let
alone a way of cleanly mapping exit statuses to signal names.  Sometimes
the best things are the ones you just come to depend on so much that you
forget how unusual they are.)
-- 
--> Phil Pennock ; GAT d- s+:+ a22 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++
E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+
G+ e+ h* !r y?



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