test the exit status inside a shell

Nathaniel Ingersoll nate at altos86.UUCP
Fri Sep 30 08:44:52 AEST 1988


	In article <3741 at boulder.Colorado.EDU> wu at spot.Colorado.EDU (WU SHI-KUEI) writes:
	>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.
	>
	>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 at sun.com



More information about the Comp.unix.questions mailing list