For this problem I have two values, curdir and curlevel, which change throughout my script. I want to know if it's possible to create a variable and then use that value as the name for another value. For example
temp="dir_${curdir}_${curlevel}"
$temp=$name_of_directory **<----Is there a legitimate way to do this?**
so if initially curdir=1 and curlevel=0 then
$(temp)=directory_one
is equal to
dir_1_0=directory_one
then later if curdir=2 and curlevel=4, I can reset temp and then have
$(temp)=another_directory
is the same as
dir_2_4=another_directory
so I could make a call such as
cd $(temp)
which will move me to different directories when I need to