On 10/24/22 4:52 AM, Emanuele Torre wrote:
On 24/10/2022, Robert Elz wrote:
There's no reason that wait (the command) cannot check for candidate
jobs which are still running, and wait for any of those, and then
return as soon as there are none left. That the shell happens to
have forked
On 10/23/22 10:25 PM, Emanuele Torre wrote:
I don't think the process running `cat' is a sibling of the subshell.
It's not, but in this case it doesn't matter. `wait' without arguments
should wait for the last process substitution only if it's the same as
$!. You can wait for other process
27 Ekim 2022 Perşembe tarihinde Chet Ramey yazdı:
>
> Yep, this is a problem. I'll have a fix in the next devel branch push.
>
Thanks
--
Oğuz
On 10/23/22 3:47 AM, Oğuz İsmail Uysal wrote:
To reproduce:
$ echo $BASH_VERSION
5.2.2(3)-release
$ ( : & wait ) > >(cat)
*hangs*
It should return immediately, but hangs instead.
Yep, this is a problem. I'll have a fix in the next devel branch push.
--
``The lyf so short,
Date:Mon, 24 Oct 2022 16:16:21 +0200
From:Emanuele Torre
Message-ID:
| It does not make any sense that you keep insisting that this is about
| bash internals, or low level system call (especially `wait', `fork',
| etc),
Since that is the exact opposite of
; | In case you did not understand, the issue is not that "wait inside
> | subshell waits for sibling", because the process that runs `cat' IS NOT
> | a sibling of the process that runs `wait', it is a CHILD.
>
> I understand that, but you are missing the point. This is where the
ommand as mentioned).
I understand that.
| In case you did not understand, the issue is not that "wait inside
| subshell waits for sibling", because the process that runs `cat' IS NOT
| a sibling of the process that runs `wait', it is a CHILD.
I understand that, but you are m
isn't what some people might expect is irrelevant.
What do you mean? The problem that was described is caused by that
optimisation (not the version that is applied to simple commands that
run external program, but to subshell compound command as mentioned).
In case you did not understand, the issue is
24 Ekim 2022 Pazartesi tarihinde Robert Elz 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
>
Date:Mon, 24 Oct 2022 04:25:44 +0200
From:Emanuele Torre
Message-ID:
| bash performs an optimisation that runs redirections applied to simple
| commands that run external programs, or subshell compound commands after
| the fork(). (to avoid having to restore
24 Ekim 2022 Pazartesi tarihinde Emanuele Torre
yazdı:
>
> To inhibit this optimisation, you can wrap your subshell compound
> command (or simple command) in a group command, and apply the
> redirections to it instead of the subshell command:
>
> { (: & wait) ;} > >(cat)
>
> Or, in your
I don't think the process running `cat' is a sibling of the subshell.
bash performs an optimisation that runs redirections applied to simple
commands that run external programs, or subshell compound commands after
the fork(). (to avoid having to restore file descriptors after running
the
To reproduce:
$ echo $BASH_VERSION
5.2.2(3)-release
$ ( : & wait ) > >(cat)
*hangs*
It should return immediately, but hangs instead.
13 matches
Mail list logo