[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Feature request for the 'local' builtin command - passthrough return sta
Feature request for the 'local' builtin command - passthrough return status
Sun, 17 Dec 2006 20:30:05 -0700
First off, please CC me on any replies because there are no instructions on
the FSF bash page (http://directory.fsf.org/bash.html) to tell me how to
subscribe to this list.
My request is to add a new switch to the 'local' builtin which tells it to not
modify the return status (I use the -p switch for this below). I have never
once used the return status from local, although I understand it is necessary.
However, I often use local like this:
local var=$(echo -n message | something_pipey)
However, if I want to check the return status of my command substitution, I
have to do something like this:
var=$(echo -n message | something_pipey) || die
Much nicer would be something like this:
local -p var=$(echo -n message | something_pipey) || die
Perhaps it is silly to ask for this, but at the same time, it makes sense
to me because there is variable assignment allowed within the local command.
If you allow assignment you have to assume that someone's going to use command
substitution to make the assignment.
- Feature request for the 'local' builtin command - passthrough return status,
Daniel Webb <=