Good day, everyone!
I've got a small problem with re-assigning the variable form the loop. What I'm trying to do is:
#!/bin/bash/
VAR1="AAA"
VAR2="BBB"
VAR3="CCC"
for WORD in VAR1 VAR2 VAR3;
do
$WORD="DDD"
echo $WORD
done
:o
That's the output and error messages:
-bash: VAR1=DDD: command not found
VAR1
-bash: VAR2=DDD: command not found
VAR2
-bash: VAR3=DDD: command not found
VAR3
I'd really appreciate if anybody could explain how to perform such operations.
Thank you in advance for any suggestions