sigizmund.com
Probably, the most horrible UNIX command I've ever written
By sigizmund On October 19, 2009 · 501 Commenthttp%3A%2F%2Fsigizmund.com%2Fprobably-the-most-horrible-unix-command-ive-ever-written%2FProbably%2C+the+most+horrible+UNIX+command+I%26%23039%3Bve+ever+written2009-10-19+15%3A10%3A20sigizmundhttp%3A%2F%2Fsigizmund.wordpress.com%2F2009%2F10%2F19%2Fprobably-the-most-horrible-unix-command-ive-ever-written
pv enwiki.xml | grep -C1 ‘<title>’ | tr -d ‘ ‘ | sed ‘s/<title>//’ | sed ‘s/</title>//’ |
sed ‘s/<id>//’ | sed ‘s/</id>//’ | sed ‘s/<page>//’ | tr -d ‘ ‘ | grep -v ‘^$’ |
tr ‘n’ ‘t’ | tr ‘-’ ‘n’ | grep -v ‘^$’ > title_id.txt
I know it’s probably as efficient as spaghetti code is – but hey! It works and does what I want it to!
One Response to Probably, the most horrible UNIX command I've ever written
Leave a Reply Cancel reply
-
Categories
-
Calendar
May 2012 M T W T F S S « Feb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -
Meta





The command was corrected to:pv enwiki.xml | grep -C1 ” | sed ‘s///’ | sed ‘s/<\/title>//’ | sed ‘s/<id>//’ | sed ‘s/<\/id>//’ | sed ‘s/<page>//’ | tr ‘\n’ ‘\t’ | tr ‘-’ ‘\n’ | grep -v ‘^$’ > title_id.txt