question-- Bourne (and C) SHELL

David Herron, NPR Lover david at ukme.UUCP
Tue Sep 2 05:06:45 AEST 1986


In article <3220 at brl-smoke.ARPA> swa at COMET.LCS.MIT.EDU (Steven Augart) writes:
>    if ls foo
>    then
>            ;
>    else
>            echo "foo not found"
>    endif

Or:

	#! /bin/sh
	# not.sh -- Logical NOT of the return status of a command
	#
	# USAGE: not command
	#
	if $@; then
		exit 1
	else
		exit 0
	fi

Allowing one to say:

	if not rsh e /bin/true; then
		echo ^G^Ge is down^G^G
	fi
-- 
David Herron,  cbosgd!ukma!david, david at UKMA.BITNET, david at ms.uky.csnet
	(I'm also "postmaster" at all those addresses)
	(And "news" and "netnews" and "uucp" and ....)



More information about the Comp.unix.wizards mailing list