From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079346819487.tru64-unix-managers.marc@archive.invalid> From: Danielle Georgette Date: Tue, 09 May 2000 05:14:42 +0000 To: tru64-unix-managers Subject: a possibly even stupider scripting question X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079346819487 Puzzler (for me) number two - its a different script, giving a menu system to operators allowing them to restore backups. According to the menu option they pick, a generic restore code takes different options and will or won't restore the current filesystem. That's the plan, anyway. I've hit a point where I need a variable to resolve down two 'levels' - ie the menu option process has set d1_backup=true the filesystem currently being examined is d1, so fsnum=d1, and I need to test if ${fsnum}_backup is true so setup the conditions for this example: # d1_backup=true # echo $d1_backup true # fsnum=d1 # echo $fsnum d1 # echo ${fsnum}_backup d1_backup and the trouble begins. How the #*@!% can I get the assignment to resolve? I feel kinda poor offloading script questions here thought its been a slow day on the ol' list so I hope you don't mind. # tempcase='$'${fsnum}_backup # echo $tempcase $d1_backup # tempcase=$"${fsnum}_backup" # echo $tempcase $d1_backup # tempcase="\$${fsnum}_backup" # echo $tempcase $d1_backup # echo ${tempcase} $d1_backup # tempcase=$"$fsnum"_backup # echo $tempcase $d1_backup #echo `echo $tempcase` $d1_backup etc..etc.. Any ideas? I'm guessing this one is going to be as simple as the last, but in the last two days i've read the man sh, csh and ksh pages til its just dribbles of text in front of my eyes and i'm not getting any further. Last scripting question from me, I promise! Danielle +-----------------------------------+---------------------------------+ | Danielle Georgette | Unix is very user friendly, its | | Unix Admin | just rather particular about | | danielle.georgette@asx.com.au | who it makes friends with. | +-----------------------------------+---------------------------------+ | All opinions are my own unless clearly stated otherwise. | +---------------------------------------------------------------------+