[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: more efficient AS_EXIT
From: |
Eric Blake |
Subject: |
Re: more efficient AS_EXIT |
Date: |
Tue, 18 Nov 2008 19:09:12 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 11/18/2008 6:56 PM:
>> Hmm. This exposes it:
>
>> $ sh -ec 'trap '\''echo $?'\'' 0; false;'
>> 0
>
>> But at the same time:
>> $ sh -c 'set -e; trap '\''echo $?'\'' 0; false;'
>> 1
>
>> Weird.
Is it indeed the status of the command prior to the one that triggers the
errexit? For example, what happens on:
$ sh -ec 'trap '\''echo $?'\'' 0; : && (exit 2); echo a; : && (exit 3);
false; echo b'
If it shares the pdksh bug where ': && (exit 2)' triggers errexit, even
though it is a list and not a simple command, then the trap executes prior
to the 'echo a', but does that result in 0 or 2? If it is like bash, then
the 'echo a' will execute, but do we see 0 or 3? Finally, if the 'echo b'
executes, then something is seriously broken with the 'set -e' implementation.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkjdUgACgkQ84KuGfSFAYAFdwCdEf4I2thHFpUXE0U0DwsbvTUO
GmkAn1UWILXoDlkHsdVRYCxY8i27D/RF
=7x8n
-----END PGP SIGNATURE-----
- Re: more efficient AS_EXIT, Eric Blake, 2008/11/18
- Re: more efficient AS_EXIT, Eric Blake, 2008/11/18
- Re: more efficient AS_EXIT, Paolo Bonzini, 2008/11/19
- Re: more efficient AS_EXIT, Eric Blake, 2008/11/19
- Re: more efficient AS_EXIT, Paolo Bonzini, 2008/11/20
- Re: more efficient AS_EXIT, Eric Blake, 2008/11/20
- Re: more efficient AS_EXIT, Paolo Bonzini, 2008/11/21
- Re: more efficient AS_EXIT, Eric Blake, 2008/11/21
- Re: more efficient AS_EXIT, Ralf Wildenhues, 2008/11/22
- Re: more efficient AS_EXIT, Ralf Wildenhues, 2008/11/22