Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!usc!ucla-cs!oahu!kirkaas From: kirkaas@oahu.cs.ucla.edu (paul kirkaas) Newsgroups: comp.unix.questions Subject: How do I ask "if NOT" in shell? Message-ID: <28381@shemp.CS.UCLA.EDU> Date: 22 Oct 89 23:13:27 GMT Sender: news@CS.UCLA.EDU Reply-To: kirkaas@oahu.UUCP (paul kirkaas) Organization: UCLA Computer Science Department Lines: 15 How can one say "if not" in a shellscript; that is, execute the body of the "then" only if the argument of "if" returns a non-zero exit status? I would like something like: if ! TESTCOMMAND then BODY fi Stupid question? Trivial answer? I hope so. Thanks. Paul Kirkaas kirkaas@cs.ucla.edu