bug-bash
[Top][All Lists]
Advanced

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

Re: bash loses control of jobs inside a command substitution


From: Oğuz
Subject: Re: bash loses control of jobs inside a command substitution
Date: Wed, 20 Nov 2019 15:18:35 +0300

Behavior of wait -n differs on interactive and non-interactive sessions
though, maybe this really is a bug

    $ bash -ic '( ( sleep 0.1; exit 13 ) & sleep 0; wait -n; echo $? )'
    0
    $ bash -c '( ( sleep 0.1; exit 13 ) & sleep 0; wait -n; echo $? )'
    13

On Wed, Nov 20, 2019 at 1:01 PM Oğuz <oguzismailuysal@gmail.com> wrote:

> This seems more like a race condition, see:
>
>     $ f() { ( sleep 0.1; exit 13 ) & "$@"; wait -n; echo $?; }
>     $
>     $ f sleep 0.0
>     [1] 30612
>     [1]+  Exit 13                 ( sleep 0.1; exit 13 )
>     13
>     $ f sleep 0.2
>     [1] 30617
>     [1]+  Exit 13                 ( sleep 0.1; exit 13 )
>     127
>


reply via email to

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