[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: waiting for process substitutions
From: |
Chet Ramey |
Subject: |
Re: waiting for process substitutions |
Date: |
Fri, 5 Jul 2024 14:45:36 -0400 |
User-agent: |
Mozilla Thunderbird |
On 7/2/24 9:59 PM, Zachary Santer wrote:
I *am* seeing a difference between having lastpipe enabled (and job
control off) or not when running your example in the interactive
shell, though:
SECONDS=0; echo $'foo\nbar' | tee >(echo first ; exit 1) >(wc ; sleep
10 ; echo wc) >(tail -n 1; echo tail); wait; printf '%s\n'
"SECONDS=${SECONDS}"
With lastpipe disabled, wait exits immediately.
There are no process substitutions or asynchronous processes for `wait'
to return, since the last pipeline element containing the procsubs is
executed in a child process.
With lastpipe enabled,
it does seem to wait for everything.
The last pipeline element is executed in the current environment, and
any side effects persist in the current environment, so you have process
substitutions for `wait' to return.
I didn't look at the script behavior, since you don't have any pipelines
where lastpipe might have an effect.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
- Re: waiting for process substitutions, Mark March, 2024/07/02
- Re: waiting for process substitutions, Chet Ramey, 2024/07/03
- Re: waiting for process substitutions, Martin D Kealey, 2024/07/03
- Re: waiting for process substitutions, Zachary Santer, 2024/07/03
- Re: waiting for process substitutions, Chet Ramey, 2024/07/05
- Re: waiting for process substitutions, Greg Wooledge, 2024/07/05
- Re: waiting for process substitutions, Dale R. Worley, 2024/07/08
- Re: waiting for process substitutions, Chet Ramey, 2024/07/08
- Re: waiting for process substitutions, alex xmb sw ratchev, 2024/07/08
- Re: waiting for process substitutions, Chet Ramey, 2024/07/08
- Re: waiting for process substitutions, alex xmb sw ratchev, 2024/07/08