shell 变量中的问号 (?)

Ger*_*ery 2 string variables shell

我想使用具有以下名称的变量:topMiddleOligocenetoUpperEocene?

我怎样才能在 shell 脚本中做到这一点(即使用问号)?我试过:

{topMiddleOligocenetoUpperEocene?}="something"
Run Code Online (Sandbox Code Playgroud)

但我的 shell 脚本中不理解它(myfile.sh 在第一行中使用 #!/bin/sh)。

任何提示将不胜感激,提前致谢。

gle*_*man 5

不能。这不是 bash 中的有效标识符。name请参阅http://www.gnu.org/software/bash/manual/bashref.html#Definitions定义

姓名

仅由字母、数字和下划线组成且以字母或下划线开头的单词。名称用作 shell 变量和函数名称。也称为标识符。