Created
March 17, 2015 23:50
-
-
Save havenwood/742ed2d922622a7bc1f9 to your computer and use it in GitHub Desktop.
An example of Ruby stdlib's Shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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