Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 614 Bytes

README.md

File metadata and controls

28 lines (19 loc) · 614 Bytes

dorian-each

Evaluates some code on each line of the input

e.g. ls -l | each "puts l.split.first"

Install

gem install dorian-each

Or as part of my other gems:

gem install dorian

Usage

From my history:

pbpaste | each "puts line.split('-')[1].split.first" | uniq
git grep Thing test/ | grep isocode | each "puts l.split(':').first" | sort | uniq | xvim
cat file.csv | each "code, name = l.split(\"\\t\"); if code.include?(','); puts code; else; puts code.gsub(' ', '') + ',' + name; end"
git grep thing | grep " doc " | each "puts l.split(':').first" | xvim