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

Re: bug: $? after empty command



On Thu, 9 Jul 2009 21:41:51 +0000 (UTC)
Eric Blake <ebb9@xxxxxxx> wrote:
> Eric Blake <ebb9 <at> byu.net> writes:
> 
> > But just from inspection,
> > it looks like it does not cover these related issues, which are both required
> > by POSIX to output 0:
> > 
> > $ zsh -c 'false; . /dev/null; echo $?'
> > 1
> > $ zsh -c 'false; ``; echo $?'
> > 1
> 
> And another one that POSIX requires to output 0:
> 
> $ zsh -c 'false; sleep& echo $?'
> 1

These still need fixing.

Also, I don't think it affects POSIX, because empty functions aren't
required to work, but in zsh, "fn() { }" is valid, and I suspect "fn"
logically ought to reset the status, too---basically anywhere where you've
run a complex command with an empty list of commands in it.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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