bug-bash
[Top][All Lists]
Advanced

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

Re: Unhelpful behaviors in 4.2.10(1)


From: Chet Ramey
Subject: Re: Unhelpful behaviors in 4.2.10(1)
Date: Sat, 09 Jun 2012 12:54:44 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120601 Thunderbird/13.0

On 6/9/12 3:05 AM, Linda Walsh wrote:
> 

>> To sum up ". sdf2"  is returning 1
>> Bash considers . to be a simple command even though what's really
>> executed is [[ $# -ge 2 ]] && echo hello.
> ---
>     Right.... It's NOT a simple command.

To be clear: `.' is a shell builtin, with its own semantics and exit status:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_18

Like any other builtin, it's a simple command when executed as one.
And like any other builtin, if it returns a non-zero exit status when
errexit is enabled, the shell will exit.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/





reply via email to

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