Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Aug 2002 10:46:23 -0400
From:      Antoine Beaupre <anarcat@anarcat.ath.cx>
To:        Gavin Atkinson <gavin@ury.york.ac.uk>
Cc:        "C.J." <clayton@frii.net>, <freebsd-stable@FreeBSD.ORG>, <tjr@FreeBSD.ORG>
Subject:   Re: /bin/sh changed?
Message-ID:  <71A173FE-AA14-11D6-9D65-0050E4A0BB3F@anarcat.ath.cx>
In-Reply-To: <Pine.BSF.4.33.0208071035470.65875-100000@ury.york.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wednesday, August 7, 2002, at 05:40 AM, Gavin Atkinson wrote:

> On Tue, 6 Aug 2002, The Anarcat wrote:
>
>> Note that the mysql script is quite odd, in itself. It comes back to:
>>
>> sh -c 'true & && echo foo'
>>
>> which is quite foolish anyways.
>
> I don't see what the problem with this is, and am of the opinion that if
> this particular construct does not work, it should. (Note i'm not 
> talking
> about the obviously wrong "||exit 1" following a line which does not end
> with a backslash).
>
> Surely, the construct "foo & && echo foo" should be allowable, and 
> should
> mean "run foo in the background, and if successfull, say so". If foo is
> not found, or not executable, or if the shell couldn't fork due to low
> memory, then don't print that it was successful. This is what I have 
> used
> it for in the past.

Thechnically, '&&' means run RHS if LHS succeeds (RHS: Right Hand Side, 
LHS: Left).

Since foo & isn't ran in a subshell, there's no exit status, since 
there's no exit! So it's not a valid construct, period.

I've stumbled upon this in my early shell coding days.

A.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?71A173FE-AA14-11D6-9D65-0050E4A0BB3F>