test -v with array elements

2020-05-29 Thread Luiz Angelo Daros de Luca
fined This only fails when A is an empty array, which might be correct. Regards, --- Luiz Angelo Daros de Luca luizl...@gmail.com

bash loses control of jobs inside a command substitution

2019-11-19 Thread Luiz Angelo Daros de Luca
) 'wait -n' lacks a way to get dead child PID, requiring some race conditions techniques to get it. Regards, -- Luiz Angelo Daros de Luca luizl...@gmail.com

Re: Racing condition leads to unstable exit code

2017-05-05 Thread Luiz Angelo Daros de Luca
e lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, UTech, CWRU c...@case.edu > http://cnswww.cns.cwru.edu/~chet/ > -- Luiz Angelo Daros de Luca luizl...@gmail.com

Re: Racing condition leads to unstable exit code

2017-05-03 Thread Luiz Angelo Daros de Luca
Yes, the devel one does work. Sorry for the confusion. It is the first time I see master as stable. Would the fix be backported to stable? Em qua, 3 de mai de 2017 às 19:33, Chet Ramey escreveu: > On 5/3/17 6:07 PM, Luiz Angelo Daros de Luca wrote: > > Strange... I still get 0 > &

Re: Racing condition leads to unstable exit code

2017-05-03 Thread Luiz Angelo Daros de Luca
t; > Chet > > > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, UTech, CWRUc...@case.edu > http://cnswww.cns.cwru.edu/~chet/ > -- Luiz Angelo Daros de Luca luizl...@gmail.com

Re: Racing condition leads to unstable exit code

2017-05-02 Thread Luiz Angelo Daros de Luca
ot; USR1 x=$(kill -USR1 $$; sleep 0.5; exit 2) echo "$BASHPID:err=$? (should be 2)" >&2 $ bash a.sh 18239:err=0 (should be 2) If sleep inside trap is 0, err=2. If sleep is greater than 1, err=0 Regards, Em qui, 29 de set de 2016 às 16:39, Chet Ramey escreveu: > On 9/23/16 3:04

Inconsistent behavior between 'wait' and 'builtin wait'

2017-05-02 Thread Luiz Angelo Daros de Luca
avior was exactly the one I was trying to implement. I guess command wait could have an optional argument for both behavior (exit or ignore on signal). Is this expected and simply not documented (doc bug), or both wait should be equal? I just don't want to rely on a bug behavior that might break in the future. Regards, -- Luiz Angelo Daros de Luca luizl...@gmail.com

Re: Racing condition leads to unstable exit code

2016-09-30 Thread Luiz Angelo Daros de Luca
( Child stuff... Send USR1 to parent ) & wait2 $! Em sex, 30 de set de 2016 09:45, Chet Ramey escreveu: > On 9/29/16 10:58 PM, Luiz Angelo Daros de Luca wrote: > > No problem! I already workarounded it using pipe as a semaphore. Thanks! > > > > It's there any ch

Re: Racing condition leads to unstable exit code

2016-09-29 Thread Luiz Angelo Daros de Luca
t de 2016 16:39, Chet Ramey escreveu: > On 9/23/16 3:04 PM, Luiz Angelo Daros de Luca wrote: > > Hello, > > > > I'm using 'GNU bash, version 4.3.46(1)-release (x86_64-suse-linux-gnu)' > > provided by OpenSUSE Tumbleweed. I recently faced a problem that, > d

Racing condition leads to unstable exit code

2016-09-23 Thread Luiz Angelo Daros de Luca
D echo "$BASHPID:I'm installing trap USR1..." >&2 trap trap_USR1 USR1 x=$(testme) echo "$BASHPID:err=$? (should be equal previous return) command substitution" >&2 testme return 2 while $? on the last line gets 0. I'll attach a full version script. Regards, -- Luiz Angelo Daros de Luca luizl...@gmail.com full.sh Description: application/shellscript

Re: Random parser error of $() when there is a case inside

2015-12-07 Thread Luiz Angelo Daros de Luca
Thanks Chet and Dennis, Dennis, your workaround did work. Regards, Em sáb, 5 de dez de 2015 às 18:58, Chet Ramey escreveu: > On 12/4/15 1:25 PM, Luiz Angelo Daros de Luca wrote: > > > Bash Version: 4.2 > > Patch Level: 53 > > Release Status: release > > > &

Random parser error of $() when there is a case inside

2015-12-04 Thread Luiz Angelo Daros de Luca
echo 123 #<- and this runs!! check stdout! ;; esac done ) echo Fail OUTPUT: OK OK a.sh: command substitution: line 33: syntax error: unexpected end of file 123 a.sh: line 30: syntax error near unexpected token `;;' a.sh: line 30: ` ;;' -- Luiz Angelo -- Luiz Angelo Daros de Luca