Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jul 2009 19:03:39 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Adrian Wontroba <aw1@stade.co.uk>
Cc:        Brett Glass <brett@lariat.net>, chat@freebsd.org
Subject:   Re: Bourne shell short-circuit operators improperly documented
Message-ID:  <867hy5sz2s.fsf@ds4.des.no>
In-Reply-To: <20090718024835.GB8379@steerpike.hanley.stade.co.uk> (Adrian Wontroba's message of "Sat, 18 Jul 2009 03:48:35 %2B0100")
References:  <200907172257.QAA15292@lariat.net> <20090718000116.GA8379@steerpike.hanley.stade.co.uk> <200907180121.TAA16416@lariat.net> <20090718024835.GB8379@steerpike.hanley.stade.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Adrian Wontroba <aw1@stade.co.uk> writes:
> Perhaps the syntax could have been " and " / " or " (as in Perl's
> and / or statement qualifiers (something() or die "oops";), but it is
> far too late to change sh syntax. We have to live with it or use a
> different shell or language.

Pop quiz: what are the semantics of the follwing command line after your
proposed change:

echo I need a box and cat litter for my new kittens.

There is absolutely nothing surprising or illogical about the && and ||
command separators.

There is absolutely nothing surprising about "zero means success, non-
zero means failure" either - that's how most Unix system calls and many
standard C library functions work.

I'm sure we all have better things to do than argue about this non-
issue.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?867hy5sz2s.fsf>