in reply to Re^2: 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 ?

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

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

Replies are listed 'Best First'.
Re^4: How to change a script's environment after the script is already run, based on shell sourcing ?
by shmem (Chancellor) on Sep 28, 2006 at 09:23 UTC
    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}