trying to create new variables whose names contain a variable. For instance, I've tried...
x=2
while test $x -ge 1
do
var_$x="Hello $x"
x=`expr $x - 1`
done
echo $var_2
echo $var_1
this script outputs...
var_2=Hello 2: not found
var_1=Hello 1: not found
thanks for any help.
x=2
while test $x -ge 1
do
var_$x="Hello $x"
x=`expr $x - 1`
done
echo $var_2
echo $var_1
this script outputs...
var_2=Hello 2: not found
var_1=Hello 1: not found
thanks for any help.