Unix Programming - Re: Substituting the value of an environment variable that is passed

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2004 > Re: Substituting the value of an environment variable that is passed





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Substituting the value of an environment variable that is passed
Heiko

2004-08-24, 7:06 pm

Chuck Dillon wrote:
> Anil Venugopalan wrote:
>
>
>
> $ crap='$HOME'
> $ echo $crap
> $HOME
> $ eval echo $crap
> /export/home/cdillon
> $ foo=`eval echo $crap`
> $ echo $foo
> /export/home/cdillon


Or (bash):

$ crap=HOME
$ echo ${!crap}
/home/heiko

Regards,

Heiko
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com