Path: utzoo!utgpu!attcan!uunet!husc6!XAIT!mirror!necntc!necis!pbush
From: pbush@necis.UUCP (Paul Bush)
Newsgroups: comp.unix.questions
Subject: Re: test the exit status inside a shell
Keywords: exit status
Message-ID: <703@necis.UUCP>
Date: 29 Sep 88 12:25:56 GMT
References: <5651@sgistl.SGI.COM> <3741@boulder.Colorado.EDU>
Reply-To: pbush@necis.UUCP (Paul Bush)
Organization: NEC Information Systems, Boxborough, MA
Lines: 18

In article <3741@boulder.Colorado.EDU> wu@spot.Colorado.EDU (WU SHI-KUEI) writes:
>In article <5651@sgistl.SGI.COM> larry@sgistl.SGI.COM (Larry Autry) writes:
>>Is there a way to test the exit status of the previously executed process
>>while in a shell?  In other words, if the previous program returned an exit
>>status of (2) (or even (0)), then perform something based upon that return 
>>value.
>
>The shell variable $? is set to the exit status of the last executed command.
>



The above variable '$?' works fine for the Bourne shell (sh).  The
equivilant C-shell variable is '$status'.

Good Luck
Paul Bush
(necis!pbush)