2011-06-26 41 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.

相關問題