Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!vsi1!altnet!altos86!nate From: nate@altos86.UUCP (Nathaniel Ingersoll) Newsgroups: comp.unix.questions Subject: Re: test the exit status inside a shell Keywords: exit status Message-ID: <606@altos86.UUCP> Date: 29 Sep 88 22:44:52 GMT References: <5651@sgistl.SGI.COM> <3741@boulder.Colorado.EDU> Reply-To: nate@altos86.UUCP (Nathaniel Ingersoll) Organization: Altos Computer Systems, San Jose, CA Lines: 20 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. > >Carl Brandauer In csh, the shell variable $status is set to the exit status of the last command. -- Nathaniel Ingersoll Altos Computer Systems, SJ CA ...!ucbvax!sun!altos86!nate altos86!nate@sun.com