bug-bash
[Top][All Lists]
Advanced

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

Re: Question about the return value of 'local'


From: Chet Ramey
Subject: Re: Question about the return value of 'local'
Date: Thu, 13 Dec 2012 09:25:41 -0500

> Actually I was asking for the case when 'local' is not used:
> 
>   foo=$(echo bar; false)
> 
> this assignment expression returns false, and I'm wondering where
> that's documented.

Look in 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.

It's the final paragraph.

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/



reply via email to

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