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

Re: 'case' zeroes "$?"



Op 09-10-16 om 23:01 schreef Martijn Dekker:
> Example:
> 
> (exit 37) || case $? in 37) echo "$?";; esac
> 
> All shells except zsh and Busybox ash output 37; zsh outputs 0.

Actually, busybox ash just fixed this as well, see:
https://bugs.busybox.net/show_bug.cgi?id=9311
https://git.kernel.org/cgit/utils/dash/dash.git/commit/?id=da534b740e628512e8e0e62729d6a2ef521e5096

FreeBSD sh, another Almquist derivative, also outputs 37.

Thanks,

- M.



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