Re: exit status when setting local variables

2006-03-27 Thread Chet Ramey
Mike Frysinger wrote: > not sure if this is a bug or feature ... take this little snippet: > testit() { > local foo=$(false) ; echo $? > foo=$(false) ; echo $? > } > > when we run the code, the output is: > 0 > 1 > > rather than intuitive: > 1 > 1 It's intentional. `local' returns s

exit status when setting local variables

2006-03-27 Thread Mike Frysinger
not sure if this is a bug or feature ... take this little snippet: testit() { local foo=$(false) ; echo $? foo=$(false) ; echo $? } when we run the code, the output is: 0 1 rather than intuitive: 1 1 -mike ___ Bug-bash mailing list Bug