Command line perl

I find this much more useful than sed. Example 1: Filter/regex. Print numbers from matching lines. foo 12 bar 23 other baz 34 -e is script mode. -n loops over your input automatically. # -n option does the while loop for you horse:~ adam$ perl -ne ‘print “$1\n” if /(\d+)/’ foo.txt 12 23 34 Without… Continue reading Command line perl

Published
Categorized as geek Tagged ,