in reply to How to change a script's environment after the script is already run, based on shell sourcing ?
Assuming you have the filename ahead of time, just parse it yourself:
our $file = '/etc/profiles/bashrc.ora.v.10'; open my $fh, "< $file" or die "open: $!"; while (defined($_ = <$fh>)) { next unless /^export\s+([A-Za-z]\w+)=(.*)$/; $ENV{$1} = $2; } close($fh);
--rjray
|
|---|
| 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 graff (Chancellor) on Sep 29, 2006 at 00:20 UTC | |
by rjray (Chaplain) on Sep 29, 2006 at 04:18 UTC |