Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command substitution: zsh waits until command exits
- X-seq: zsh-workers 24150
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: command substitution: zsh waits until command exits
- Date: Mon, 03 Dec 2007 20:20:09 -0800
- In-reply-to: <071203191510.ZM5279@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20071130133943.GG5855@xxxxxxxxxxxxxxxxxxx> <071130073719.ZM18090@xxxxxxxxxxxxxxxxxxxxxx> <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>
[> zsh-workers]
On Dec 3, 7:15pm, Bart Schaefer wrote:
} Subject: Re: command substitution: zsh waits until command exits
}
} 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 suspect that what's happening is that zsh is losing the exit status
} on its way from step 2 to step 4 of the expansion sequence
Is it really this easy? There must be something I'm missing.
Index: Src/exec.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/exec.c,v
retrieving revision 1.34
diff -c -r1.34 exec.c
--- Src/exec.c 26 Nov 2007 17:38:13 -0000 1.34
+++ Src/exec.c 4 Dec 2007 04:17:17 -0000
@@ -2331,7 +2331,7 @@
lastval = 0;
return;
} else {
- cmdoutval = 0;
+ cmdoutval = lastval;
if (varspc)
addvars(state, varspc, 0);
if (errflag)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author