Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Expected behavior of background jobs in ${ ... }



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