Run a Ruby snippet for each input line.
gem install dorian-eachAlso included in the aggregate gem:
gem install dorianeach [options] [file ...] "ruby code"Run each -h for generated option details and each -v for the installed version.
- Sets
itto each stripped line. Useful options include--progress,--debug,--rails,--stdout,--stderr, and--colorize.
printf '1\n2\n' | each "puts it.to_i * 2" -c falseOutput:
2
4