Re: Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-11 Thread Chet Ramey
On 8/10/11 10:59 PM, Clark J. Wang wrote: How can people write stable scripts in an enironment of constant change? This is creating the exact opposite of what POSIX is supposed to help! I found the similar problem. Bash has changed a lot since 2.05b which is the 1st version of bash I've

Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Linda Walsh
Chet Ramey wrote: Yes. It's a case of not saving and restoring enough state across possibly- recursive calls to the shell parser. (The assignment statement is the key in this case.) So, I compared subst.c files from bash-4.1-9 and bash-4.2-10 and was able to build a patch that it

Re: Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Eric Blake
On 08/10/2011 03:59 PM, Linda Walsh wrote: Is this a fluke, due to the above changes NOT being 4.1? Or is this construction going to break in 4.2: '$((( )))' According to POSIX, this construction should be parsed as an arithmetic substitution $(()) where the expression is (expr), if at all

Re: Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Chet Ramey
On 8/10/11 5:59 PM, Linda Walsh wrote: Chet Ramey wrote: Yes. It's a case of not saving and restoring enough state across possibly- recursive calls to the shell parser. (The assignment statement is the key in this case.) So, I compared subst.c files from bash-4.1-9 and

Re: Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Linda Walsh
Eric Blake wrote: On 08/10/2011 03:59 PM, Linda Walsh wrote: Is this a fluke, due to the above changes NOT being 4.1? Or is this construction going to break in 4.2: '$((( )))' According to POSIX, this construction should be parsed as an arithmetic substitution $(()) where the expression is

Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Dennis Williamson
I thought the $( ) was necessary to make the inner (()) an arithmetic expression...  Does it execute in a sub process? No, $( ) is for process substitution, $(( )) is for an arithmetic context. I normally (in Bash), use (( )) outside the whole expression since it gives me complete freedom of

Re: Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Chet Ramey
On 8/10/11 8:57 PM, Linda Walsh wrote: Chet Ramey wrote: Is this a fluke, due to the above changes NOT being 4.1? Or is this construction going to break in 4.2: '$((( )))' What does `break' mean? It's already written in a manner more confusing and obscure than

Re: Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Chet Ramey
On 8/10/11 8:44 PM, Linda Walsh wrote: It sounded to me like $(( )) would be translated into $( () ), turning off arithmetic expansion. Did I read that incorrectly? Yes. You missed the content of the resolution and changed language in the standard: The syntax

Re: Is bash dying or dead (was Re: 4.1 is $((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Clark J. Wang
On Thu, Aug 11, 2011 at 5:59 AM, Linda Walsh b...@tlinx.org wrote: Bash is becoming very unstable -- programs that work in 3.1 won't necessarily work in 3.2, those in 3.2 aren't compat with 4.0, 4.0 is different than 4.1, and now 4.2 is different than 4.1. How can people write stable