Hi.
Quote:
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.
-- excerpt from Bash Reference Manual
|
Note that the $ is not listed.
There is a way that the look of your requirement can be done -- essentially as an indirect assignment:
Code:
#!/bin/bash -
# @(#) z1 Demonstrate indirect assignment.
echo
a=0
b=1
a=b
echo " first assignment a = $a, b = $b"
echo
$a=2
echo " second assignment a = $a, b = $b"
echo
eval $a=2
echo " eval assignment a = $a, b = $b"
exit