huangwason
Programmer
I am trying to assign such as a1=1, a2=2, ... , a8=8, and I wrote a script such like
for (( b=1; b <= 8 ; b++ ))
do
a$b=$b
echo $(a$b)
done
the output as
./for-loop.sh: line 6: A1=1: command not found
./for-loop.sh: line 7: a1: command not found
what is the problem?
for (( b=1; b <= 8 ; b++ ))
do
a$b=$b
echo $(a$b)
done
the output as
./for-loop.sh: line 6: A1=1: command not found
./for-loop.sh: line 7: a1: command not found
what is the problem?