Ruby as pattern filter
Ruby can also be used to parse string directly from shell prompt.
This simple script only output each line to stdout
, but it is possible to use ruby
's full regexp functionality to perform filtering in any way you want.
cat file.txt | ruby -e 'STDIN.read.split("/n").each { |l| puts l }