Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: How to change a script's environment after the script is already run, based on shell sourcing ?

by graff (Chancellor)
on Sep 29, 2006 at 00:20 UTC ( #575442=note: print w/replies, xml ) Need Help??


in reply to Re: How to change a script's environment after the script is already run, based on shell sourcing ?
in thread How to change a script's environment after the script is already run, based on shell sourcing ?

That would probably work fine for a majority of cases, where the shell script for environment setup tends to be pretty simple and explicit. It's a good-enough solution when you know enough about the shell script to trust that it will work.

But I can easily imagine (and have seen) examples where the value assigned to a relevant exported variable refers to some other shell variable that was set previously in the same file (and not necessarily exported), or is the output of some back-ticked command, or other arcane cleverness. For shell scripts like that, you really don't want this approach.

  • Comment on Re^2: How to change a script's environment after the script is already run, based on shell sourcing ?

Replies are listed 'Best First'.
Re^3: How to change a script's environment after the script is already run, based on shell sourcing ?
by rjray (Chaplain) on Sep 29, 2006 at 04:18 UTC

    True, but the original author hinted that the file contained only simple environment variables in the vein of ORACLE_SID and similar.

    There's probably a CPAN module already that handles the special cases and back-ticks, in fact...

    --rjray

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://575442]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2022-06-26 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (86 votes). Check out past polls.

    Notices?