in reply to get environment variables from a bourne file

Some commentary on your posted code:

In any case, you should probably follow Anonymous Monk's links above for some other approaches to solving this issue.

Replies are listed 'Best First'.
Re^2: get environment variables from a bourne file
by choroba (Cardinal) on May 12, 2011 at 14:45 UTC
    Sometimes, variables might get set as
    x=$(some-command)
    or even, horrors:
    eval $x=6
    You can use set to list all the variables and their values after running the script.
Re^2: get environment variables from a bourne file
by BradV (Sexton) on May 12, 2011 at 14:30 UTC

    Thanks to all. I'll take a look. Right, I'm trying to add to the default %ENV hash. I have a perl module that I wrote that gets a couple of variables out of it. It works fine under Solaris 10, and RHEL 5. However, RHEL 6 seems to treat the environment slightly differently. The variables that I get from env.sh in the other OS's work fine. However not showing up in RHEL 6. So, the reason for this little bit a kludge. :)