[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: |
Wed, 3 Jul 2024 11:21:40 -0400 |
User-agent: |
Mozilla Thunderbird |
On 6/29/24 8:47 AM, Zachary Santer wrote:
From the manual:
wait [-fn] [-p varname] [id ...]
Wait for each specified child process and return its termination
status. Each id may be a process ID or a job specification; if a job
spec is given, all processes in that job's pipeline are waited for. If
id is not given, wait waits for all running background jobs and the
last-executed process substitution, if its process id is the same as
$!, and the return status is zero. [...]
Why do this?
Because it sets $!. You should always be able to wait for $!. Originally
there was no way to wait for a process substitution at all.
Why not just wait for all process substitutions?
Process substitutions are word expansions, with a scope of a single
command, and are not expected to survive their read/write file descriptors
becoming invalid. You shouldn't need to `wait' for them; they're not
true asynchronous processes.
--
``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 <=
- 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
- Re: waiting for process substitutions, Greg Wooledge, 2024/07/08