I have a set of variables:
f1="./someFolder"
.
.
f10="./someOtherFolder"
And I'm trying to use the following loop
for (( i = 0; i <= 10; i++ ))
do
temp=f$i
done
I'm trying the get the values from my set of variable to make directories, but I can't seem the get those value from temp. I've tried ${$temp}, and a lot of combinations of brackets and quotes, if there a way of doing this? Thank you.
well, yeah
1.- proof read before you post, and use code tags.
2.- post the entire script. The way it is, I don't know what shell you are using (figured out it is bash, because that syntax doesn't work in korn) and I have no idea what you are doing after declaring temp.
Anyway, here's a better solution using arrays in korn:
# cat tester
#!/usr/bin/ksh
set -A FOLDERS folder1 folder2 folder3 folderwhatever
for x in $(echo ${FOLDERS[@]}); do
echo $x
done
# ./tester
folder1
folder2
folder3
folderwhatever