Michael Wang wrote:

> "
> line 5: syntax error in conditional expression: unexpected token `('
> line 5: syntax error near `@(a'
> line 5: `if [[ "a" == @(a) ]]'
> "
> 
> when run under bash. I believe it should not because "extglob"
> is enabled inside the function. If I run the script inside the
> function line by line, it works. And if "extglob" is enabled
> outside the function, it also works.

Nope.  Will not work, cannot work.  A function definition is parsed
in its entirety before any commands within are executed.  Since the
extglob option changes the behavior of the parser, it must be enabled
before trying to parse the function.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live Strong.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to