Re: local keyword hides return code of command substitution

2015-09-22 Thread Greg Wooledge
On Tue, Sep 22, 2015 at 10:19:56AM -0400, idal...@home.idallen.ca wrote: > Description: > Adding a "local" keyword to a variable assignment hides the > return code of a command substitution. Same problem in both > bash and dash shells. Yes, this is how it works. If you care abo

Re: local keyword hides return code of command substitution

2015-09-22 Thread Stephane Chazelas
2015-09-22 11:45:20 -0400, Greg Wooledge: > On Tue, Sep 22, 2015 at 10:19:56AM -0400, idal...@home.idallen.ca wrote: > > Description: > > Adding a "local" keyword to a variable assignment hides the > > return code of a command substitution. Same problem in both > > bash and dash shells

Re: local keyword hides return code of command substitution

2015-09-22 Thread Eric Blake
On 09/22/2015 08:19 AM, idal...@idallen-fibe.dyndns.org wrote: > Description: > Adding a "local" keyword to a variable assignment hides the > return code of a command substitution. Same problem in both > bash and dash shells. > Not a bug. $() substition can only affect $? if i

local keyword hides return code of command substitution

2015-09-22 Thread idallen
bstitution assignment on another line and check the return code there. If the behaviour of "local" can't be changed, perhaps the man page could warn about this? Repeat-By: Run this: #!/bin/bash -u # Using "local" keyword hides retu