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