Originally posted by: SystemAdmin
Hi, I am a intermediate programmer, experienced in Java, REXX, and other script languages, and am new to KSH. I am trying to combine two variables to evaluate to the combination, but it seems I may have a) poor syntax, or b) wrong code structure.
I've researched this in many places and read through documentation, but am convinced that the answer lies in "experience". To me, this seems to be a very rudimentary question, yet try as I might, just about every combination I can think, I've yet to achieve the correct results.
So here's the scenario:
I created (and exported) some environmental variables within my .profile. They are $ENV1, $ENV2, $ENV3 and $VARLINES. These evaluate correctly when performing an echo of the vars.
I then try to combine the "$ENV" with a generated number "$snum" and would like these var to evaluate properly.
In the code snippet attached, line 15 is the line I need evaluated properly
e.g. SERVERS
$snum=$ENV
$snum needs to evaluate to SERVERS[1] = $ENV1
SERVERS[2] = $ENV2 and finally SERVERS[3] = $ENV3
Attached is a code snippet to demonstrate.
Thank you in advance
#AIX-Forum