ruby-one-liners

TIL about the Ruby one-liners cookbook.

It has tons of interesting examples about how to achieve things in Ruby that we would previously rely on awk or sed to tackle.

A small example of what you will find there:

$ ruby -rset -ane 'BEGIN{s=Set.new}; (s.add($F[0]); next) if ARGV.size==1;
                   print if s.include?($F[0])' dept.txt marks.txt