Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by rjray (Chaplain)
on Sep 28, 2006 at 08:38 UTC ( #575307=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 ?

If the environment hasn't been set up in the shell, then parsing "bash --env" isn't going to help him. He needs to parse the env-file itself.

--rjray

  • 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 Corion (Patriarch) on Sep 28, 2006 at 08:55 UTC

    Uh - I was thinking of instead just running the login shell running the login shell and then sourcing the file-to-be-sourced, and then dumping env:

    perl -e '$env = `/bin/ksh -c ". /vol1/osabst/.wms_profile; env"`; prin +t $env'

    The process of parsing that output is the same as the process of parsing the login environment.

    Update: s/\sset/env/, as per shmem's comment

      You want env, not set, since you're interested in environment variables only.

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2022-05-20 08:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?