At 2009-08-07 10:48AM, "Ken Feng" wrote:
>  I have a bash file ~/.myenv that contains environmental variables like:
>  
>  export EDITOR=vi
>  export FOO=bar
>  ..
>  
 
Since Ruby is not Bash, you have to parse the file:

    File.foreach("myenv") do |line| 
      line.chomp.scan(/^export (.+?)=(.*)$/) do |name, val| 
        ENV[name] = val
      end
    end

    p ENV['FOO']  # => "bar"


-- 
Glenn Jackman
    Write a wise saying and your name will live forever. -- Anonymous