On 03/11/2010 09:27 AM, Marc Herbert wrote: > Chet Ramey wrote: > >> To Posix, assignment statements never fail -- assignment errors cause >> non- interactive shells to exit, period. In that case, it's possible >> to reflect the exit status of a command substitution in the exit >> status of a command consisting only of assignment statements,... > > It's possible... and required by POSIX, right?
POSIX says nothing about local. But yes, POSIX requires that: a=$(b) set $? to the status of running the command substitution. > Here you seem to imply this is actually an "advanced" and thus > non-standard feature (why I have no clue). An unreliable feature would > never have been standardized for sure... The question at hand is whether: local a=$(b) should set the exit status to the command substitution (a change in behavior), or to the status of running the 'local' command (the current behavior). I threw out the question about change as a discussion point, but I'm perfectly fine with Chet's response that the current behavior will stay as is. If you'd like 'local' to be standardized in the next version of POSIX, several years from now, that would also be a good goal; help in submitting the proposal to the Austin group would be appreciated. -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature