[PLUG] Okay after awk I need....

Paul Heinlein heinlein at madboa.com
Sat May 7 05:32:00 UTC 2005


On Fri, 6 May 2005, techmage wrote:

> More like:
>
> twilan_burger_zn at 007box.de
> kzpipfj at 007mundo.com
> angelique_headnj at 0711veranstaltungstechnik.de
> horaciojallison_mh at 0a0.de
> maryconner_bg at 1-msv.de
> jamison_xx at 1-seeit.com
> 1zbyinj8eiwz4fgpmnoxjbvceqpqpp at 102908.reply.avantflare.com
> 1zbyuxtios69epqzwxyhtl5mo0y7b1 at 103158.reply.morninginbox.com
> 1zbyttpeko25almvstudph1ikwu2b0 at 103209.reply.herecomesthebank.com
> 1zbym9vu04ilq12b89aj5xho0cag9b at 103466.reply.1leto.com

Assuming that the "domain" section you seek is the last two elements 
of the domain portion of the address, it's pretty simple in bash. This 
snippet assumes the addresses are in a file named 'addrlist.txt' and 
that you have a fairly recent installation of GNU grep (which 
understands the -o option):

while read addr
do
   echo "$addr" | grep -o '[^.@]*\.[^.]*$'
done < addrlist.txt

-- Paul Heinlein <heinlein at madboa.com>



More information about the PLUG mailing list