Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Created August 31, 2012 16:43
Show Gist options
  • Save kwilczynski/3555665 to your computer and use it in GitHub Desktop.
Save kwilczynski/3555665 to your computer and use it in GitHub Desktop.
>> ^DC02FX09GDH2G:~ krzysztof.wilczynski$ irb
>> require 'open3'
=> true
>> p = ENV['PATH'] ; ENV['PATH'] = ''
=> ""
>> Open3.popen3('date') {|i,o,e| o.gets }
=> nil
>> ENV['PATH'] = p
=> "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/munki"
>> Open3.popen3('date') {|i,o,e| o.gets }
=> "Fri 31 Aug 2012 17:43:17 BST\n"
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment