Command line Ruby

November 7th, 2007

This is a handy template to start from when you want to use Ruby on the command line instead of shell scripting. The template just lists all files in the current directory, but is easy to extend.

ruby -e "require 'rubygems'; require 'rake'; FileList['*'].each{ |x| puts %x{ls -l \"#{x}\"} }"

Sorry, comments are closed for this article.