bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Feature request for the 'local' builtin command - passthrough return sta


From: Daniel Webb
Subject: Feature request for the 'local' builtin command - passthrough return status
Date: Sun, 17 Dec 2006 20:30:05 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

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:

local var
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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]