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 #*_at_!% 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_at_asx.com.au | who it makes friends with. |
+-----------------------------------+---------------------------------+
| All opinions are my own unless clearly stated otherwise. |
+---------------------------------------------------------------------+
Received on Tue May 09 2000 - 05:21:34 NZST