Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug? Output not flushed?
- X-seq: zsh-workers 52148
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Bug? Output not flushed?
- Date: Fri, 15 Sep 2023 10:30:05 -0700
- Archived-at: <https://zsh.org/workers/52148>
- In-reply-to: <CAHYJk3QbXntu6F7MAcweg5m0iRXp0QmuSkdWP2DfDxNJ=TYHWg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YnQmbVqNKHmt6nthB-+1KdFYhXt2vfVu2_uHP6S5RxMg@mail.gmail.com> <CAHYJk3QbXntu6F7MAcweg5m0iRXp0QmuSkdWP2DfDxNJ=TYHWg@mail.gmail.com>
On Fri, Sep 15, 2023 at 10:05 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> I'm not sure if that diagnosis is correct, look at this:
> % { print XXX; return 0; } >| /tmp/newfile; echo hello; print $(</tmp/newfile)
>
> ie, does the return just return from the whole statement?
Hrm. I was trying to come up with an example that DID NOT depend on
my ${ ... } nofork patch, but the semantics of return seem to make
that impossible.
If you have my full set of nofork patches installed:
% set -vx
% print IN ${ print NOFORK; return 0; } OUT
>| /tmp/zshw44kFq { print NOFORK; return 0; ;}
+Src/zsh:3> print NOFORK
+Src/zsh:3> return 0
REPLY="$(</tmp/zshw44kFq)"
+Src/zsh:3> print IN OUT
IN OUT
The redirection has happened, the print has happened, and the
assignment to REPLY has happened, but the file was empty when read.
Unless something is actually aborting the $(...) ... will have to dig
further.
Thanks for the observation.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author