[Top][All Lists]

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

Re: syntax check of procedure definition fails if extglob is not set

From: Chet Ramey
Subject: Re: syntax check of procedure definition fails if extglob is not set
Date: Tue, 15 May 2007 14:17:58 -0400
User-agent: Thunderbird (Macintosh/20070326)

Elmar Stellnberger wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i586
> OS: linux
> Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1
> -L/usr/src/packages/BUILD/bash-3.1/../readline-5.1
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'
> -DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i586-suse-linux'
> -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
> -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -O2 -march=i586
> -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g
> -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -pipe -g -fbranch-probabilities
> uname output: Linux sonic #1 Tue Sep 19 07:26:15
> UTC 2006 i686 i686 i386 GNU/Linux
> Machine Type: i586-suse-linux
> Bash Version: 3.1
> Patch Level: 17
> Release Status: release
> Repeat By:
>> shopt -u extglob
>> hug() { echo !(hugo); }
> bash: !: event not found
> OK:
>> shopt -s extglob
>> hug() { echo !(hugo); }
>> ...
> Description:
>   Procedure definitions ought to be scanned and parsed independent of
> any current shopt setting. 

Commands entered at the keyboard are subject to history expansion, when
it's active, regardless of whether or not a function definition is being

The fact that the extglob setting inhibits history expansion when it
appears that an extended pattern is being parsed is a heuristic:  it's
what is wanted most of the time.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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