I bet the threat is dead and I'm actually replying to some advertisers now :-) But the issue posted by the OP made me post, really!
One of the problems with calling your script like this:
Code:
./test.ksh -l x ; where x="a b"
The part after the semicolon is not going to be parsed to your script; The semicolon is parsed by the shell first, and has the special meaning. Read up on that.
Your script indeed makes no sense to me, right now. I have no clue what you may want to accomplish and why you would want to do it this way... write a scripting language into a scripting language?
You
could change things a bit around; assuming -l is the parameter for "array name", you
could use -w for your "where" clause:
Code:
./test.ksh -l x -w x="a b"
With getopts you can parse your parameters and their values; but why you'd explicitly want to have your variable name in a variable itself is beyond me...