test the exit status inside a shell

WU SHI-KUEI wu at spot.Colorado.EDU
Thu Sep 29 07:15:07 AEST 1988


In article <5651 at sgistl.SGI.COM> larry at 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.

Just a guest here - In real life
Carl Brandauer
{ncar|stcvax}!nbires!bdaemon!carl



More information about the Comp.unix.questions mailing list