echo hello world | ruby -pe '$_.capitalize!'
printf 'hello\nworld\nhello\n' | ruby -le 'puts STDIN.to_a.uniq
ps | ruby -lane 'BEGIN { b = 0 }; b += $F[0].to_i; END { print "sum of PIDs: #{b}" }
select whatever column you want, to sum up.Really what Ruby needs is a flag that adds some capabilities to NilClass, so that these BEGIN blocks aren't needed.