[Top][All Lists]

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

Re: Function definition syntax inconsistencies

From: Jan Schampera
Subject: Re: Function definition syntax inconsistencies
Date: Sat, 14 Jun 2008 00:59:29 +0200
User-agent: IceDove (X11/20080509)

Chet Ramey wrote:

>> -----------------------------
>> $ function name (echo)
>> bash: syntax error near unexpected token `echo'
>> -----------------------------

> It's not.  It's a shift/reduce conflict in the grammar.  The default
> yacc/bison behavior is to choose the `function word () command' production,
> and I have left it that way.  The `function word command' form came from
> ksh, which doesn't allow the construct you used anyway (it requires one
> or more newlines after the word), so the current bash implementation
> supports all existing ksh uses.

Okay, then it could be mentioned in the manual (as exception or so, like
the semikolon in {...;} "for parsing reasons"). Some beginner pointed me
at this, thinking he made a mistake or didn't understand the manual.

Sorry for not providing a manpage patch.

This is my life - this is my net!
- Jan

reply via email to

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