bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: waiting for process substitutions


From: Dale R. Worley
Subject: Re: waiting for process substitutions
Date: Thu, 04 Jul 2024 21:31:06 -0400

Reading this discussion, I notice a subtlety.  If you execute:

$ command-A >( command-1) <( command-2 )
$ command-B

when command-B executes, command-2 must have terminated already because
command-A wouldn't have seen the EOF from command-2 until command-2
terminated.  (OK, I am assuming here that command-A did read its second
argument until EOF, and that's not guaranteed.)  But there's no
guarantee that command-1 has terminated; all that command-B can depend
on is that EOF was *sent* to command-1.

However, the documentation talks of $! possibly being the PID of
command-1 etc., but my (old) manual page doesn't describe how $! could
be set to be the PID of command-1, or even how a script could determine
the PID of command-1 in order to set $! to that number.  (Although it
does describe that if $! is the PID of command-1, then "wait without id"
will wait for $!.)

Dale



reply via email to

[Prev in Thread] Current Thread [Next in Thread]