Re: set -e yet again (Re: saving bash....)

2011-08-12 Thread Linda Walsh
Greg Wooledge wrote: On Fri, Aug 12, 2011 at 12:19:59PM -0700, Linda Walsh wrote: Under -e, it would fail on the 'let' statement This is one of the cases I mention on http://mywiki.wooledge.org/BashFAQ/105 AND there, you explain WHY this needs to be fixed. Your final recomm

Re: set -e yet again (Re: saving bash....)

2011-08-12 Thread Greg Wooledge
On Fri, Aug 12, 2011 at 12:19:59PM -0700, Linda Walsh wrote: > Under -e, it would fail on the 'let' statement This is one of the cases I mention on http://mywiki.wooledge.org/BashFAQ/105 > "-e" -- in a WELL DESIGNED PROG***, where errors are caught, > shouldn't cause a otherwise working progr

Re: set -e yet again (Re: saving bash....)

2011-08-12 Thread Linda Walsh
Greg Wooledge wrote: On Fri, Aug 12, 2011 at 08:18:42AM -0700, Linda Walsh wrote: > If I write a==0 on the bash command line, it will generate an error. > > a=0 does not. 'Bash' knows the difference between an assignment and > a equality test in math. imadev:~$ ((a==0)) imadev:~$ ((a=0))

Re: set -e yet again (Re: saving bash....)

2011-08-12 Thread Greg Wooledge
On Fri, Aug 12, 2011 at 08:18:42AM -0700, Linda Walsh wrote: > If I write a==0 on the bash command line, it will generate an error. > > a=0 does not. 'Bash' knows the difference between an assignment and a > equality test in math. imadev:~$ ((a==0)) imadev:~$ ((a=0)) imadev:~$ a==0 imadev:

Re: set -e yet again (Re: saving bash....)

2011-08-12 Thread Linda Walsh
Greg Wooledge wrote: On Thu, Aug 11, 2011 at 11:56:10PM -0700, Linda Walsh wrote: **Exception** declare -i a a=0 -- As a is declared to be an integer, it has the results evaluated at assignment time. a=0 is an integer expression that doesn't set $?=1 Neither should: ((a=0)) a=0 is an

Re: set -e yet again (Re: saving bash....)

2011-08-12 Thread Eric Blake
On 08/12/2011 06:51 AM, Greg Wooledge wrote: On Thu, Aug 11, 2011 at 11:56:10PM -0700, Linda Walsh wrote: **Exception** declare -i a a=0 -- As a is declared to be an integer, it has the results evaluated at assignment time. a=0 is an integer expression that doesn't set $?=1 Neither sho

set -e yet again (Re: saving bash....)

2011-08-12 Thread Greg Wooledge
On Thu, Aug 11, 2011 at 11:56:10PM -0700, Linda Walsh wrote: > **Exception** > declare -i a > a=0 > -- > As a is declared to be an integer, it has the results evaluated > at assignment time. a=0 is an integer expression that doesn't set > $?=1 > Neither should: > ((a=0)) a=0 is an assignme

Re: saving bash.....(bash usefulness vs. being, orwellianly 'standardardized')

2011-08-11 Thread Linda Walsh
Eric Blake wrote: On 08/10/2011 10:39 PM, Linda Walsh wrote: "It sounded to me like $(( )) would be translated into "$( () )", turning off arithmetic expansion. Did I read that ___incorrectly__? Yes, you read it incorrectly. --- *thankyou* POSIX is saying that _if_ you want to

Re: saving bash.....

2011-08-11 Thread Eric Blake
On 08/10/2011 10:39 PM, Linda Walsh wrote: Chet Ramey wrote: > If not, then wouldn't > $((( ))) be turned into $( (( )) ), meaning the arith returns a > status, > and not the calculation. (I've tested this, and this is the case. Then I said: "It sounded to me like $(( )) would be translated in

Re: saving bash.....

2011-08-10 Thread Linda Walsh
Chet Ramey wrote: > If not, then wouldn't > $((( ))) be turned into $( (( )) ), meaning the arith returns a > status, > and not the calculation. (I've tested this, and this is the case. This is demonstrably false. --- No... you've only proven that you should have a bit of 'compassion' for