in reply to sourcing a shell script/.profile and importing into %ENV
It isn't pretty, something along these lines should do the trick:
#!/usr/bin/perl $sourcefile = "/etc/unsafe_profile.sh"; # or whatever chomp(@newenv = qx ( . $sourcefile; env) ); foreach (@newenv) { ($k,$v) = split "=",$_,2; $ENV{$k}=$v; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: sourcing a shell script/.profile and importing into %ENV
by gnu@perl (Pilgrim) on Mar 21, 2003 at 20:06 UTC | |
Re: Re: sourcing a shell script/.profile and importing into %ENV
by zengargoyle (Deacon) on Mar 21, 2003 at 21:12 UTC | |
Re: Re: sourcing a shell script/.profile and importing into %ENV
by gnu@perl (Pilgrim) on Mar 21, 2003 at 19:54 UTC |