From: James Adam Date: 2006-07-03T00:44:53+09:00 Subject: Re: How to open a console and ruby a ruby script from ruby? Beware that you're technically detecting both windows and mac (darwin) with /win/. You might want to check for win32 (or, i suppose, win64?) instead. - james On 7/2/06, Sean O'Halpin wrote: > Windoze equivalent inserted below :) > > On 7/1/06, ara.t.howard@noaa.gov wrote: > > > > fortytwo :~ > cat a.rb > > require 'rbconfig' > > require 'tempfile' > > > > def console command > > arch = Config::CONFIG['arch'] > > > > unless arch =~ %r/win/i > > tmp = Tempfile.new Process.pid.to_s > > tmp << command > > tmp << "\n" > > tmp << "bash" > > tmp << "\n" > > tmp.close > > begin > > system "xterm -e 'bash -l -i #{ tmp.path }'" > > ensure > > tmp.close! > > end > > else > system "start cmd /k #{command}" > > end > > end > > > > console 'date' > > > > Regards, > Sean > > -- * J * ~