Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Expected behavior of background jobs in ${ ... }
- X-seq: zsh-workers 52199
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Expected behavior of background jobs in ${ ... }
- Date: Mon, 2 Oct 2023 17:48:07 -0700
- Archived-at: <https://zsh.org/workers/52199>
- List-id: <zsh-workers.zsh.org>
Consider:
echo ${ { sleep 10; echo foo; } & { sleep 5; echo bar; } & echo done; }
The only version of ksh I can conveniently test, discards the output
of the background jobs and substitutes only "done". This is in
conflict with $( ... ) which delays for 10 seconds and then
substitutes "done bar foo".
It is conceivably possible to keep track of jobs started during the ${
... } substitution and force the shell to wait for them, but then
there's this case:
echo ${ { echo foo; } & { echo bar; } & echo done; }
Here ksh also discards the output of the background jobs and
substitutes only "done", but that may be an order of operations thing.
The current zsh implementation substitutes
foo
bar
done
but that's likely nondeterministic.
Is this worth worrying about?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author