AWK: extract e-mail addresses from a Unix passwd file
Friday, June 23, 2006 10:09:18 AM
As I occasionally need to write an e-mail to a student I never had contact with before, I used awk to extract e-mail addresses from the /etc/passwd file.
awk -F: '{print $5" <" $1 "@" mh ">"}' mh="cip.ifi.lmu.de" ./passwd > mail_list.txt
Output:
Programmierpraktikum Prgprakt <pp99@cip.ifi.lmu.de> Programmierpraktikum Prgprakt <prgprakp@cip.ifi.lmu.de> ...






