Re: Evaluating a variable within a variable

2007-10-23 Thread Matthew Woehlke
Paul Jarc wrote: TimtheEagle <[EMAIL PROTECTED]> wrote: main_auth=7 f=main t=auth ile=$f"_"$t echo $ile Either: echo "${!ile}" Not portable. Or: eval "echo \"\$$ile\"" Portable (even to Solaris /bin/sh which is not POSIX). Not saying which you should use, just something to be awa

Re: Evaluating a variable within a variable

2007-10-23 Thread Paul Jarc
TimtheEagle <[EMAIL PROTECTED]> wrote: > main_auth=7 > > f=main > t=auth > > ile=$f"_"$t > > echo $ile Either: echo "${!ile}" Or: eval "echo \"\$$ile\"" paul

Evaluating a variable within a variable

2007-10-23 Thread TimtheEagle
Hi, my problem is best desrbied with a simple example as follows. I know that technically it is not correct but it illustrates what I am struggling to achieve. # main_auth=7 f=main t=auth ile=$f"_"$t echo $ile I want the output from echo on the line above to be 7. The m