Created
January 21, 2014 03:46
-
-
Save jtbrough/8534168 to your computer and use it in GitHub Desktop.
Email Address Munging and De-munging Using SED https://en.wikipedia.org/wiki/Address_munging
https://en.wikipedia.org/wiki/Sed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# de-munge email address | |
# | |
# accepts a munged email address in one of the following formats (in this case piped from the OS X clipboard) | |
# 1) something at domain dot com | |
# or | |
# 2) something at domain (dot) com | |
# all spaces will be removed | |
# | |
echo `pbpaste` | sed -e 's/ at /@/' -e 's/ dot /./' -e 's/ (dot) /./' -e 's/ //g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# munge email address | |
# | |
# accepts a standard email address (in this case piped from the OS X clipboard) | |
# expected email format [email protected] | |
# | |
echo `pbpaste` | sed -e 's/@/ at /' -e 's/[.]/ (dot) /' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment