Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created March 17, 2015 23:50
Show Gist options
  • Save havenwood/742ed2d922622a7bc1f9 to your computer and use it in GitHub Desktop.
Save havenwood/742ed2d922622a7bc1f9 to your computer and use it in GitHub Desktop.
An example of Ruby stdlib's Shell
require 'shell'
Shell.verbose = false
Shell.def_system_command 'ls'
Shell.def_system_command 'grep'
sh = Shell.cd Dir.home
sh.transact do
ls('-a') | grep('^\.') > STDOUT
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment