[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] Shell function names (was: New eclass: xdg-basedir)
From:       Ulrich Mueller <ulm () gentoo ! org>
Date:       2014-01-30 15:44:11
Message-ID: 21226.29515.666827.874057 () a1i15 ! kph ! uni-mainz ! de
[Download RAW message or body]


>>>>> On Thu, 30 Jan 2014, Jeroen Roovers wrote:

>> It may be little known, but strictly speaking, hyphens in bash
>> identifiers are illegal:
>> 
>> `name' A `word' consisting solely of letters, numbers, and
>> underscores, and beginning with a letter or underscore. `Name's are
>> used as shell variable and function names. Also referred to as an
>> `identifier'.

> That looks wrong for all kinds of reasons and it is directly
> contradicted in the same document and in the source code.

Sure, the implementation is so sloppy that it would even allow
^+-=[*]{@}:,./?%!!!11eleven!! as the name of a function. Which doesn't
imply that we should use such undocumented features in our code.

Ulrich

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic