I was able to do the following in batch, but for the life of me, I cannot figure out how to do this in bash and could use some help. Basically, I used a for loop and delayed expansion to set variables as the for loop iterated through an array. It looked something like this:
FOR /L %%A in (1,1,10) DO (
SET someVar = !inputVar[%%A]!
)
The brackets are merely for clarity.
I now have a similar problem in bash, but cannot figure out how "delayed expansion" (if that's even what it is called in bash) works:
for (( a=1; a<=10; a++ )); do
VAR${!a}= some other thing
done
Am I completely off base here?
Update:
So it seems that I was completely off base and @muru's hint of the XY problem made me relook at what I was doing. The easy solution to my real question is this:
readarray -t array < /filepath
I can now easily use the needed lines.