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

'case' zeroes "$?"



Unlike on other shells, 'case' on zsh zeroes "$?" before executing a
command within 'case', making it more inconvenient to test exit status.

Example:

(exit 37) || case $? in 37) echo "$?";; esac

All shells except zsh and Busybox ash output 37; zsh outputs 0.
(dash recently fixed this: 0.5.8 outputs 0, 0.5.9.1 outputs 37.)

Thanks,

- Martijn



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