Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command substitution: zsh waits until command exits
- X-seq: zsh-users 12284
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: command substitution: zsh waits until command exits
- Date: Tue, 4 Dec 2007 11:14:58 +0100
- In-reply-to: <071203191510.ZM5279@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20071130163155.GL5855@xxxxxxxxxxxxxxxxxxx> <071130185827.ZM18402@xxxxxxxxxxxxxxxxxxxxxx> <20071202021652.GO5855@xxxxxxxxxxxxxxxxxxx> <071201210744.ZM20044@xxxxxxxxxxxxxxxxxxxxxx> <20071202152254.GP5855@xxxxxxxxxxxxxxxxxxx> <071202102717.ZM2757@xxxxxxxxxxxxxxxxxxxxxx> <20071203011131.GT5855@xxxxxxxxxxxxxxxxxxx> <071203092626.ZM4367@xxxxxxxxxxxxxxxxxxxxxx> <20071204014227.GE5855@xxxxxxxxxxxxxxxxxxx> <071203191510.ZM5279@xxxxxxxxxxxxxxxxxxxxxx>
On 2007-12-03 19:15:10 -0800, Bart Schaefer wrote:
> On Dec 4, 2:42am, Vincent Lefevre wrote:
> }
> } Now, if I understand correctly,
> }
> } $(false) && echo true
> }
> } shouldn't output anything because before the &&, there's no command
> } and the command substitution has a non-zero exit status.
>
> I would have expected this to produce a shell error of some kind as
> there's no command at all to the left of the "&&". Given that it
> does not, I'd say not using the exit status of $(false) is a bug.
I think that a shell error would be a bug anyway, as POSIX defines the
case where no command name results. I think that my interpretation is
correct, as neither bash, dash or ksh93 produces a shell error, while
they produce a shell error for "&& echo true".
BTW, I suppose that if one wants to run a command FOO=bar using $PATH,
one can type:
$(true) FOO=bar
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author