i am trying to increment a variable name inside a for loop to get 4 dynamic variable in each loop, this is an example
while read line
do
for n in `seq 1 4`
do
vr$n=$(echo -e "$line" | awk '{print $'$n'}')
#test
echo vr$n
done
done < rst.txt
cat rst.txt
AAA BBB CCC DDD
111 222 333 444
*** --- /// +++
my problem is that when i try to execute the script it try to execute the result in the variable and i get an error 'command not found' any idea plz? thanks