At 02:42 PM 2/5/2011, pe...@vfemail.net wrote: > * * * >I've tried this entry in my /etc/mail/aliases file, but it returns an empty >e-mail messages: > > extract: "| perl -wne 'while(/[\S\.]+@[\S\.]+\w+/g){print "$&\n"}' | mail > user" > >[and this one]: > > extract: "| cat > datafile | perl -wne > 'while(/[\S\.]+@[\S\.]+\w+/g){print "$&\n"}' < datafile | mail user" > >but [they] return an empty e-mail message rather than a list of e-mail >addresses. > >What am I overlooking?
A kind soul helped me figure out how to make this work. This e-mail alias: extract: "| cat > /home/peter/datafile | /home/peter/extract.pl < /home/peter/datafile | mail -s \"Results\" user combined with this Perl script: #!/usr/bin/perl while (<STDIN>) { while(/[\S\.]+@[\S\.]+\w+/g){print "$&\n"}; }; delivers the desired list of e-mail addresses. ------------------------------------------------- This message sent via VFEmail.net http://www.vfemail.net $14.95 Lifetime accounts! 15GB disk! No bandwidth quotas! _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"