Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: 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:33 UTC ( [id://575304]=note: print w/replies, xml ) Need Help??


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

tilly wrote Get default login environment, and the discussion shows some changes to the script. This is what you want, except that you will likely not want the default login environment but instead your Oracle setup script.

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

Replies are listed 'Best First'.
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

    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

      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://575304]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found