Stupid Bash Tricks

Today, I try to separate a text file into two: one with well-formed addresses, and another with the silly ones. Drama ensues.

$> grep -v "\b[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,4}\b" address_list.txt

“What? Why is this returning the well-formed addresses?”

(fiddle, fiddle)

“Hmm… This is no good. Perhaps my regexp is poor?”

(fiddle, fiddle)

“Poor file formatting?”

(fiddle, fiddle… goes on for ten minutes)

Finally…

(Checks .bash_profile for this account…)

“Argh! All this time, and grep is not aliased to egrep on this machine!”

</dorkery>

0 Response to “Stupid Bash Tricks”


Comments are currently closed.