I define several variables like below:
TEMP1=1
TEMP2=1
TEMP3=1
And then I want to use them in a for loop like this, but failed. How to make it work? To use the variable with a sequence number.
for i in 0 1 2 3
do
if [[ $(TEMP{i}) -eq 1 ]]; then
do something