Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

question mark (?) in shell variable

I want to use a variable with this name: topMiddleOligocenetoUpperEocene?

how can I do it in a shell script (i.e., using the question mark)? I tried:

{topMiddleOligocenetoUpperEocene?}="something"

but it's not understood in my shell script (myfile.sh using in the first row #!/bin/sh).

Any hint will be appreciated, thanks in advance.

like image 525
Gery Avatar asked May 01 '26 10:05

Gery


1 Answers

Can't. That's not a valid identifier in bash. See the definition of name at http://www.gnu.org/software/bash/manual/bashref.html#Definitions

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.

like image 168
glenn jackman Avatar answered May 03 '26 14:05

glenn jackman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!