in reply to substitute of dotsh.pm
sub source_shell_profile { # source a shell profile and extract ENV vars my($profile) = $_[0]; local(*STDIN,*STDERR); # could just close STDIN instead, but some programs # don't deal with that very well... open(STDIN,"/dev/null"); open(STDERR,">/dev/null"); my %env = map {chomp;split(/=/,$_,2)} `. $profile; env`; return %env; }
--
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho
|
|---|