[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] "local" modifies the behavior of "$?"
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] "local" modifies the behavior of "$?" |
Date: |
Mon, 24 Jun 2013 07:22:46 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
On 6/23/13 11:39 PM, Dan Douglas wrote:
> Not documented but frequently asked.
Not quite. From the `SIMPLE COMMAND EXPANSION' section of the man page:
"If there is a command name left after expansion, execution proceeds as
described below. Otherwise, the command exits. If one of the expan-
sions contained a command substitution, the exit status of the command
is the exit status of the last command substitution performed. If
there were no command substitutions, the command exits with a status of
zero."
Similarly, the descriptions of `local' and `declare' list the conditions
under which they will return non-zero.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/