Re: 5.0 regression: Script stuck when waiting in trap

2019-06-06 Thread mwnx
On Tue, Jun 04, 2019 at 07:19:02PM -0400, Chet Ramey wrote: > On 6/4/19 4:34 PM, mwnx wrote: > > > Thanks for the explanation. In view of the change you describe, > > there is another behaviour that I think might qualify as a bug. I'll > > give you my actual use case first. > > > > I simply want to

Re: Code Execution in Mathematical Context

2019-06-06 Thread David
On Thu, 6 Jun 2019 at 03:40, Ilkka Virta wrote: > On 5.6. 17:05, Chet Ramey wrote: > > On 6/4/19 3:26 PM, Ilkka Virta wrote: > > >>$ echo "$(( 'a[2]' ))" > >>bash: 'a[2]' : syntax error: operand expected (error token is "'a[2]' ") > > > > The expression between the parens is treated as if

Re: Code Execution in Mathematical Context

2019-06-06 Thread Greg Wooledge
On Thu, Jun 06, 2019 at 11:33:56AM +1000, David wrote: > Regarding $((...)) when Chet refers above to "the expression between the > parens" > he means whatever is between the parentheses, in this case the three dots. > > If I understand correctly, Chet is saying there that $((...)) is > parsed as

Re: 5.0 regression: Script stuck when waiting in trap

2019-06-06 Thread Robert Elz
Date:Thu, 6 Jun 2019 09:57:24 +0200 From:mwnx Message-ID: <20190606075724.GA9670@noisy> | After all, it does wait for all other | kinds of processes irrespective of when they were started or how | many there are, Shells aren't required to keep track of any proc

Re: Code Execution in Mathematical Context

2019-06-06 Thread Ilkka Virta
On 6.6. 15:53, Greg Wooledge wrote: wooledg:~$ echo $(( a[$i] )) Tue 04 Jun 2019 09:23:28 AM EDT 0 wooledg:~$ echo $(( 'a[$i]' )) bash: 'a[$(date >&2)]' : syntax error: operand expected (error token is "'a[$(date >&2)]' ") I definitely got different results when I added single quotes. Wel

Re: Code Execution in Mathematical Context

2019-06-06 Thread Chet Ramey
On 6/6/19 8:53 AM, Greg Wooledge wrote: > On Thu, Jun 06, 2019 at 11:33:56AM +1000, David wrote: >> Regarding $((...)) when Chet refers above to "the expression between the >> parens" >> he means whatever is between the parentheses, in this case the three dots. >> >> If I understand correctly, Che

Re: 5.0 regression: Script stuck when waiting in trap

2019-06-06 Thread Chet Ramey
On 6/6/19 3:57 AM, mwnx wrote: >> Not quite. `wait' without arguments waits for the last process >> substitution, and the pid of that process is available in $! for the >> cases you care about. If you are sure that your script hasn't started >> any asynchronous processes since the last process sub

Re: 5.0 regression: Script stuck when waiting in trap

2019-06-06 Thread Chet Ramey
On 6/6/19 9:12 AM, Robert Elz wrote: > Whether bash works that way with processes created for process substitutions > (which are a non-standard thing to do) I don't know however. The shell doesn't really have to remember them at all -- ksh93 doesn't, for instance -- but bash remembers the last on

Re: 5.0 regression: Script stuck when waiting in trap

2019-06-06 Thread Chet Ramey
On 6/6/19 4:50 PM, Chet Ramey wrote: > On 6/6/19 9:12 AM, Robert Elz wrote: > >> Whether bash works that way with processes created for process substitutions >> (which are a non-standard thing to do) I don't know however. > > The shell doesn't really have to remember them at all -- ksh93 doesn't,