Advertisement
e55db081d05f58a

getEmails

Feb 21st, 2017
5,376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1. #Returns all emails found in the path passed as a parameter
  2.  
  3. getEmails(){ p="\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b";grep -RishEo $p $1|grep -Eios $p|awk '!u[$1]++';}
  4.  
  5. #Example use:
  6.  
  7.     #getEmails /bin
  8.  
  9. #Output
  10.     #bug-gzip@gnu.org
  11.     #charles@comm.polymtl.ca
  12.     #phil@fifi.org
  13.     #behanw@pobox.com
  14.     #schoepf@debian.org
  15.     #anton@lml.bas.bg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement