How do I ask "if NOT" in shell?

r.peterson roe at sobmips.UUCP
Thu Oct 26 14:12:44 AEST 1989


>From article <63720010 at hpl-opus.HP.COM>, by steinbac at hpl-opus.HP.COM (Gunter Steinbach):
> I prefer This form:
> 
> TESTCOMMAND || {
> 	BODY
> 	}
> 
> It doesn't allow an "else" clause, though.

I tried this:

true && {
	echo true
} || {
	echo false
}

and it functions fine.  Change true && to false && and it prints false
correctly as well.

-- 
If the brain were so simple we understood it|Roe Peterson
We would be so simple we couldn't.          |{attcan,mcgill-vision}!sobeco!roe



More information about the Comp.unix.questions mailing list