Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
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 ( [id://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

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?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-28 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found