Paul Vojta wrote: > > From: Luc Van Eycken <[EMAIL PROTECTED]> > > This is due to the fact that exit does not set the $? variable and leaves > > it to whatever the previous command returned. This happens on all my > > platforms, except Linux. > > Can you tell us some (preferably all) platforms on which you encountered > this problem? I'd always thought that "exit x" should set $? to x on all > platforms.
I guess I didn't explain it very well. As ... Thomas Esser answered: > I guess that the systems in question don't show "rc=0" when executing the > following code: > /bin/sh -c "trap 'echo rc=\$?; exit \$rc' 0; false; exit 0" > On Linux with bash and with the /bin/sh on Sun Solaris 2.7, I get "rc=0", > however. Indeed, the above code echoes "rc=1" for the following platforms, identified by 'uname -srvmp' : OSF1 V4.0 1530 alpha alpha HP-UX B.11.00 A 9000/782 unknown SunOS 5.8 Generic_108528-11 sun4u sparc IRIX64 6.5 04101930 IP27 mips Best regards, Luc Van Eycken