bug-bash
[Top][All Lists]
Advanced

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

functions whose name begins with a '-' are treated inconsistently


From: ian
Subject: functions whose name begins with a '-' are treated inconsistently
Date: Tue, 19 Feb 2002 17:11:52 -0800 (PST)

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE  -I.  -I. -I./include 
-I./lib -O2 -march=i386 -mcpu=i686
uname output: Linux jiskefet.caliban.org 2.4.17-grsec-1.9.3a #1 SMP Tue Jan 22 
11:04:12 PST 2002 i686 unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05a
Patch Level: 0
Release Status: release

Description:
        functions whose names start with a '-' are not documented as
        being illegal, but are treated as such by the declare
        built-in. In contrast, the type built-in allows them.

Repeat-By:

address@hidden ~]$ -foo() { echo bar; }
address@hidden ~]$ -foo
bar
address@hidden ~]$ type -- -foo
-foo is a function
-foo () 
{ 
    echo bar
}
address@hidden ~]$ declare -- -foo
bash: declare: `-foo': not a valid identifier

Ian
-- 
Ian Macdonald               | Oh my GOD -- the SUN just fell into YANKEE 
address@hidden             | STADIUM!! 
                            | 
                            | 
                            | 



reply via email to

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