bug-bash
[Top][All Lists]
Advanced

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

Re: Issues when func name is the same with an alias


From: Chet Ramey
Subject: Re: Issues when func name is the same with an alias
Date: Wed, 04 Aug 2010 13:39:11 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1

On 8/4/10 10:38 AM, Clark J. Wang wrote:

> Function definitions are not simple commands. Actually, func definition
> syntax is listed under the *Compound Commands* section in bash2.05b's man
> page and in bash3+ it's been moved to a separate section.

While technically true, that doesn't enter into the issue.  At the time
a word is read, the parser can't tell whether or not it introduces a
simple command or function definition.  Posix, for instance, explicitly
notes that alias expansion is performed before examining any grammar rules,
and certainly without performing any lookahead.  I probably cribbed the
"simple command" language from Posix, which doesn't allow reserved words,
which introduce compound commands, to be aliased.

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]