Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Shell function names (was: New eclass: xdg-basedir)
Date: Thu, 30 Jan 2014 15:44:25
In Reply to: Re: [gentoo-dev] Re: New eclass: xdg-basedir by Jeroen Roovers
1 >>>>> On Thu, 30 Jan 2014, Jeroen Roovers wrote:
3 >> It may be little known, but strictly speaking, hyphens in bash
4 >> identifiers are illegal:
5 >>
6 >> `name' A `word' consisting solely of letters, numbers, and
7 >> underscores, and beginning with a letter or underscore. `Name's are
8 >> used as shell variable and function names. Also referred to as an
9 >> `identifier'.
11 > That looks wrong for all kinds of reasons and it is directly
12 > contradicted in the same document and in the source code.
14 Sure, the implementation is so sloppy that it would even allow
15 ^+-=[*]{@}:,./?%!!!11eleven!! as the name of a function. Which doesn't
16 imply that we should use such undocumented features in our code.
18 Ulrich