Last active
September 25, 2017 07:19
-
-
Save urodoz/a7fa6122e39be0fa4c7dbd3f4fcb66e7 to your computer and use it in GitHub Desktop.
Bash script to extract emails from file
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
#!/bin/bash | |
#Usage: bash extract_emails.sh file.txt output.txt | |
perl -ne'if(/[\w\.\-\_]+@([\w\-\_]+\.)+[A-Za-z]{2,4}/g){print "$&\n"}' $1 | sort | uniq > $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment