Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!munnari.oz.au!cs.mu.oz.au!ok From: ok@cs.mu.oz.au (Richard O'Keefe) Newsgroups: comp.unix.questions Subject: Re: How do I ask "if NOT" in shell? Message-ID: <2513@munnari.oz.au> Date: 24 Oct 89 12:47:53 GMT References: <28381@shemp.CS.UCLA.EDU> <3787@solo6.cs.vu.nl> <8243@cbmvax.UUCP> Sender: news@cs.mu.oz.au Lines: 12 When you really want to write unless command ; then stmts fi you can do it by writing command if test $? != 0 ; then # command failed stmts fi If stmts is sufficiently simple, you can also do command || { stmts }