On Thu, 2005-06-16 at 21:25 +0200, Nicos Gollan wrote:
> On Thursday June 16 2005 21:13, michael wrote:
> > For some reason out of my control I need to pass the name of an env var
> > to a bash script and then, within said script, determine the value of
> > that env var.
> >
> > [...]
> >
> > I've tried various combos inside the script like
> >   echo ${$1}
> 
> That was pretty close, and reading the bash manpage actually helps. Read near 
> the beginning of "Parameter Expansion", there's an explanation of what you 
> want.
> 
> Try:
> echo ${!1}
> 

Fantastic! I skim read the man page too quick then (and didn't think of
searching for 'indirect')

live'n'learn

thanks!

-- 
Michael Bane
Atmospheric Physics Group
University of Manchester


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to