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

Bug involving subshell exit status in functions fixed?



Hi zsh-users,

This is a simplified version of something that got me really confused
when I tried to run a bash script in zsh.

In zsh-4.2.3, zsh-4.3.4, and bash

$ (exit 1)
$ echo $?
1

in zsh-4.3.4 and bash

$ function f {
    (exit 1)
    echo $?
}
$ f
1

but in zsh-4.2.3

$ function f {
    (exit 1)
    echo $?
}
$ f
0

So, although I can't find a mention of it because I don't know what to
search for, I think this is a bug that's fixed in the development
version of zsh.  Is there a work around for this in 4.2.3 (the version
installed on the machines where my script will be run is actually
4.2.0, but it has the same "problem" as 4.2.3)?

If this isn't a bug that was fixed, could someone explain what's going on.

Thanks,

-nathan



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