I am working on a project where variables need to be assigned according to number contained in a certain file. I feel it may be pointless to include and explain all the code, so I have reduced the question to one involving a simple example.
for ((i=1; i<=3; i++));
do
align_$i=100_$i
done
In this example code, I am getting the following error (among the other 2):
line 3: align_1=100_1: command not found
so I know my method substitution is working, but it is not recognized as a correct assignment. I am clearly making a simple mistake but really have no clue how to solve this.
A little bit of a different idea: I am having an issue calling the value of variable where the variable is doubly dependent on the looping variable. So, using the supposed correct output from the example above, if I were in another loop where I need to call align_1's value, but need to do so like
for ((i=1; i<=3; i++));
do something with $align_$i
how would I properly do this? Using these variables must be in another loop, otherwise I wouldn't have this problem!
I apologize for a simple question-- Bash is not a strength of mine.
Thank you