Re: sh: "local" assignment from command loses exit status

2014-11-07 Thread Fabian Keil
Eric van Gyzen wrote: > On 11/06/2014 12:30, Fabian Keil wrote: > > Eric van Gyzen wrote: > > > >> In sh, if I use a single statement to declare a local variable and > >> assign the output of a command to it, the exit status of that command is > >> lost. For example: > >> > >> should_return

Re: sh: "local" assignment from command loses exit status

2014-11-06 Thread Fabian Keil
Eric van Gyzen wrote: > In sh, if I use a single statement to declare a local variable and > assign the output of a command to it, the exit status of that command is > lost. For example: > > should_return_false() { > local var1=`false` > } > > The function should return non-zer

Re: sh: "local" assignment from command loses exit status

2014-11-06 Thread Eric van Gyzen
On 11/06/2014 12:30, Fabian Keil wrote: > Eric van Gyzen wrote: > >> In sh, if I use a single statement to declare a local variable and >> assign the output of a command to it, the exit status of that command is >> lost. For example: >> >> should_return_false() { >> local var1=`false`

sh: "local" assignment from command loses exit status

2014-11-06 Thread Eric van Gyzen
Jilles and -current: In sh, if I use a single statement to declare a local variable and assign the output of a command to it, the exit status of that command is lost. For example: should_return_false() { local var1=`false` } The function should return non-zero, but it returns ze