blog

alxndr's blog

View on GitHub

La trahison des mots

05 Aug 2015

Run this in your (POSIX-compliant) shell — I promise it’s not bad:

echo "ceci n'est pas une pipe" | sed -Ee 's/(eci n|pas )//g'

animation of "WAKA WAKA" above Fozzie Bear (from the Muppets) waggling his eyebrows

No seriously though folks, that’s my favorite code joke.1

This formation uses the “extended regex” option of GNU sed so I could use the |: another pipe, and it means there’s only one s/// operation. With basic regexes I guess it’d be:

echo "ceci n'est pas une pipe" | sed -e 's/eci n//' -e 's/pas //'
  1. Close second is: “What’s the best thing about UDP jokes? No one cares if you don’t get it!” …third is “Knock knock. Race condition. Who’s there?”