3 ms·
Instead of: cat foo.txt | ruby -ne 'BEGIN{ $x=[]}; $x << $_.chomp; END { puts $x.sort }' just use `sort`: sort foo.txt There's a reason these comman
by jonathonf 12y ago
Instead of:
cat foo.txt | ruby -ne 'BEGIN{ $x=[]}; $x << $_.chomp; END { puts $x.sort }'
just use `sort`:
sort foo.txt
There's a reason these commands already exist. :)