[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wait inside subshell waits for sibling
From: |
Oğuz |
Subject: |
Re: wait inside subshell waits for sibling |
Date: |
Mon, 24 Oct 2022 11:30:24 +0300 |
24 Ekim 2022 Pazartesi tarihinde Robert Elz <kre@munnari.oz.au> yazdı:
> [...] That the shell happens to
> have forked other processes for its own reasons should make no
> difference at all.
Agreed.
In the case of process substitutions it is documented that their use may
change wait's behavior
> 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 $!,
but what the manual says is not what actually happens; in the OP $! is the
PID of : & when wait is called. And it doesn't even wait for only the
last-executed one, it waits for all of them:
$ ( : & wait ) > >(sleep 3) > >(:)
*hangs for 3 seconds*
--
Oğuz