From: Glenn Jackman Date: 2009-08-08T03:55:11+09:00 Subject: Re: how to "source" a file? 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