Re: inconsistent exit status of ((count++))

2010-07-30 Thread Stefano Lattarini
At Friday 30 July 2010, Greg Wooledge wrote: > On Fri, Jul 30, 2010 at 09:49:22PM +0200, Stefano Lattarini wrote: > > But then, maybe an exit status of `2' instead of `1' in case of > > errors in ((...)) would be helpful -- currently the exit status > > is still `1' > > > > also if a real error is

Re: inconsistent exit status of ((count++))

2010-07-30 Thread Greg Wooledge
On Fri, Jul 30, 2010 at 09:49:22PM +0200, Stefano Lattarini wrote: > But then, maybe an exit status of `2' instead of `1' in case of errors > in ((...)) would be helpful -- currently the exit status is still `1' > also if a real error is present: > > $ ((1+)); echo \$?=$? > bash: ((: 1+: synta

Re: inconsistent exit status of ((count++))

2010-07-30 Thread Greg Wooledge
On Fri, Jul 30, 2010 at 07:33:00PM +0100, Andrew Benton wrote: > On 30/07/10 19:55, Stefano Lattarini wrote: > >I don't think it's a bug, it's just an effect of: > > 1. `((EXPR))' returning a non-zero exit status iff EXPR evaluates > > to zero, and > That makes no sense to me. Why would eva

Re: inconsistent exit status of ((count++))

2010-07-30 Thread Stefano Lattarini
At Friday 30 July 2010, Andrew Benton wrote: > On 30/07/10 19:55, Stefano Lattarini wrote: > > At Thursday 29 July 2010, Andrew Benton wrote: > >> andy:~$ count=0 > >> andy:~$ ((count++)) > >> andy:~$ echo $? > >> 1 > >> andy:~$ ((count++)) > >> andy:~$ echo $? > >> 0 > > > > I don't think it's a

Re: inconsistent exit status of ((count++))

2010-07-30 Thread Andrew Benton
On 30/07/10 19:55, Stefano Lattarini wrote: At Thursday 29 July 2010, Andrew Benton wrote: andy:~$ count=0 andy:~$ ((count++)) andy:~$ echo $? 1 andy:~$ ((count++)) andy:~$ echo $? 0 I don't think it's a bug, it's just an effect of: 1. `((EXPR))' returning a non-zero exit status iff EXPR ev

Re: inconsistent exit status of ((count++))

2010-07-30 Thread Stefano Lattarini
At Thursday 29 July 2010, Andrew Benton wrote: > > andy:~$ count=0 > andy:~$ ((count++)) > andy:~$ echo $? > 1 > andy:~$ ((count++)) > andy:~$ echo $? > 0 I don't think it's a bug, it's just an effect of: 1. `((EXPR))' returning a non-zero exit status iff EXPR evaluates to zero, and 2. `v

bash(1): please fix a few typos and some style stuff

2010-07-30 Thread David Prévot
Package: bash Version: 4.1-3 Severity: wishlist Tags: patch upstream Hi Chet, Matthias, While updating the French translation of Bash manual pages (for the manpages-fr-extra package), I spotted a few typos and other style stuff. Please find attached a patch against the version shipped in the sour

inconsistent exit status of ((count++))

2010-07-30 Thread Andrew Benton
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/loca

Re: Indirect expansion and arrays

2010-07-30 Thread Greg Wooledge
On Thu, Jul 29, 2010 at 10:55:51PM +0200, Bernd Eggink wrote: > It seems that indirect expansion doesn't work with arrays: ksh93 has a feature called nameref: myfunc() { nameref ref=$1 echo "array $1 has ${#ref[*]} elements" } I wouldn't mind seeing this in bash, though I'm not going to at