Re: bash loses control of jobs inside a command substitution

2019-11-20 Thread Oğuz
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 )

Re: bash loses control of jobs inside a command substitution

2019-11-20 Thread Oğuz
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ğ

Re: Locale not Obeyed by Parameter Expansion with Pattern Substitution

2019-11-20 Thread Chet Ramey
On 11/17/19 4:25 AM, Chris Carlen wrote: Bash Version: 5.0 Patch Level: 0 Release Status: release Description:   UTF-8 multibyte char string split into bytes rather than characters. Repeat-By: #!/bin/bash shopt -s extglob LC_ALL="en_US.UTF-8" # E.g., normal/expected behavior: # Create a s

Re: bash loses control of jobs inside a command substitution

2019-11-20 Thread Robert Elz
Date:Tue, 19 Nov 2019 16:51:12 -0300 From:Luiz Angelo Daros de Luca Message-ID: | And two related features requests: 1) It seems that pids args are ignored | by wait when '-n' is specified. However, it would be a nice add_on to use | the list of pids as a filt

Re: bash loses control of jobs inside a command substitution

2019-11-20 Thread Chet Ramey
On 11/19/19 2:51 PM, Luiz Angelo Daros de Luca wrote: Hello, Normally 'wait -n' will return the exit code of background process when they terminate before wait is runned. However, when bg processes and 'wait -n' runs inside a command substitution, bash loses control of bg process as soon as they

Fwd: Don't set $?=130 when discarding the current command line (not run yet) with CTRL-C?

2019-11-20 Thread Clark Wang
It's quite common for people to press CTRL-C to discard the current command line. This is harmless actually for most times except when people include $? in $PS1. I also show $? in red color when it's not 0 so it's more noticeable. So is it OK to not change $? when people are pressing CTRL-C to disc

Re: Fwd: Don't set $?=130 when discarding the current command line (not run yet) with CTRL-C?

2019-11-20 Thread Robert Elz
Date:Thu, 21 Nov 2019 10:27:08 +0800 From:Clark Wang Message-ID: | So is it OK to not change $? when people are pressing CTRL-C to | discard the input? I would say not only "OK" but "required" - $? should only ever be changed as a result of command execution (o