Re: unable to capture return value using backticks and local

2006-08-09 Thread Chet Ramey
Adam Monsen wrote: > I was incorrectly interpreting 'local' to be a modifier rather than a > separate builtin. It may be that someday. The shell already does a few things to try to make assignment statement arguments to those builtins (local, declare, export, readonly) more like assignment state

Re: unable to capture return value using backticks and local

2006-08-09 Thread Adam Monsen
On 8/8/06, Chet Ramey <[EMAIL PROTECTED]> wrote: [...] It is expected and documented. `local' is a builtin command that returns a 0 status if the assignment is performed. [...] Understood, thanks Chet. Also, thank you Paul for the workaround. I was incorrectly interpreting 'local' to be a mo

Re: unable to capture return value using backticks and local

2006-08-08 Thread Paul Jarc
"Adam Monsen" <[EMAIL PROTECTED]> wrote: > foo() > { >local TICKED=`false` >echo RV: $? > } > > foo > # prints "RV: 0", but I would expect "RV: 1" You get 0 here because that's the status from the "local" command. To get the status from a backtick command, you need the assignment to be al

Re: unable to capture return value using backticks and local

2006-08-08 Thread Chet Ramey
Adam Monsen wrote: > Bash Version: 3.1 > Patch Level: 7 > Release Status: release > > Description: >When a variable is declared local and the assigned value is > gathered from > a command enclosed in backticks, it is not possible to retrieve the > return value > of the function within the

unable to capture return value using backticks and local

2006-08-08 Thread Adam Monsen
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: i386-redhat-linux-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/sh