>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? Why not just wait for all process substitutions? If I do something like command-1 | tee >( command-2 ) >( command-3 ) >( command-4 ) with 'shopt -s lastpipe', how do I get the pids for the three process substitutions that all just got forked at the same time? Only one is going to show up in ${!}. I can't explicitly wait for the pids of all three of them if I can't get them all in the first place. Zack