first of all, thanks to all on this board, it has been a huge resource to answer most of my questions!
I am stuck on something that should really be simple, and was looking for some help.. I am using KSH on solaris and working on a script to move containers from server to server. Where i am having problems is setting a variable that should equal a different variable based on the answer..
ie
print -n "Please select the the zone to move : "; read ZONENUM
print $zone6 <-this was here for testing to show me the variable is right
ZONENAME=`eval '$'zone$ZONENUM`
print $ZONENAME
basically i have $zone1 $zone2 etc set in the script already, so i just need $ZONENAME=$zone(?) based on which number they select
when i run it i get this:
Number Zone Name
===================================================
(1) sunstage1
(2) zndvap03
(3) znbrocade1
(4) sundev1
(5) znqaap02
(6) zndvux01
(7) zndvux02
Please select the the zone to move : 7
zndvux01
./zonemgmt2[28]: zndvux02: not found
so it looks like it is close... Where am i going wrong, or is there a better way to accomplish this?
Thanks!