From: Sean O'Halpin Date: 2006-07-02T09:30:57+09:00 Subject: Re: How to open a console and ruby a ruby script from ruby? 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