[Gllug] strip invalid email addresses

Matthew King matthew.king at monnsta.net
Sat Dec 8 01:32:30 UTC 2007


Josef Assad <josef.assad at gmail.com> writes:

> Progga wrote:
>> On Fri, Dec 07, 2007 at 05:21:46PM +0000, countd wrote:
>> 
>> $ cat list.txt | sed -n "/@.*/p"
>
> You win the "Useless Use of cat Award"! :)
>
> Look at the -i argument in 'man sed'

Not to mention that '@.*' is exactly equivalent to '@'.

Or that grep would be far more suitable, viz. 'grep @ list.txt'.

Perl, of course, is always an option:

perl -e 'open LIST, "<list.txt"; @list = <LIST>; close LIST; @email =
grep (/\@/, @list); print foreach @email'

Matthew

-- 
I must take issue with the term "a mere child", for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list