Email List: Xaustin-group-lX
[All Lists]

Re: Re: Re: Re: value of $? in trap handler after exit n

To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Re: Re: Re: value of $? in trap handler after exit n
From: Geoff Clare <yyy@xxxxxxxxxxxxx>
Date: Sun, 12 Nov 2006 12:00:57 +0000
References: <200611102040.PAA43697@xxxxxx> <Pine.LNX.4.64.0611102026170.18619@xxxxxx> <20061111130536.GA1560@xxxxxx> <45561c77.WqR3xAlLB/Xt7Ady%Joerg.Schilling@xxxxxx>
Joerg Schilling <yyyyyyyyyyyyyyy@xxxxxxxxxxxxxxxxxxx> wrote, on 11 Nov 2006:
>
> > Interestingly, the POSIX shells on Solaris 10 and HP-UX 11 are both
> > inconsistent here.  They treat $? one way, but a plain "exit" the
> > other way:
> >
> > $ sh -c "trap 'echo \$?' EXIT && exit 1"     
> > 0
> > $ sh -c 'trap "exit" EXIT; exit 3' ; echo $?
> > 3
> 
> On Solaris 9 .. 11, this prints 0 in both cases

Sounds like you used /bin/sh.  On Solaris 8 and 10 with the POSIX
shell (/usr/xpg4/bin/sh) I get the results shown above.

-- 
Geoff Clare <yyyyyyy@xxxxxxxxxxxxx>
The Open Group, Thames Tower, Station Road, Reading, RG1 1LX, England

<Prev in Thread] Current Thread [Next in Thread>