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    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to