2011-06-26 42 views

回答

1

http://www.gnu.org/software/bash/manual/bashref.html

name

A word consisting solely of letters, numbers, and underscores, and beginning with a letter or underscore. Names are used as shell variable and function names. Also referred to as an identifier.

在左手侧的值不是一个标识符。这是一个表达。因此该命令(评估整个表达式)无效。

换句话说,您不能在名称中包含星号,并且您无法通过执行一些数学运算(乘法)来生成变量名称。

+0

很酷,感谢您的参考! – abc

1

变量标识符的无效字符(星号)。

1

POSIX定义外壳变量名称由字母数字和下划线组成,而不是以数字开头。 (有些特殊变量违反了这个规则;它们总是单个字符,它们不能与用户定义的变量相冲突。)

3.230 Name

In the shell command language, a word consisting solely of underscores, digits, and alphabetics from the portable character set. The first character of a name is not a digit.

相关问题