----- Original Message ----- From: "antenneX" <[EMAIL PROTECTED]> To: "Giorgos Keramidas" <[EMAIL PROTECTED]> Cc: <freebsd-questions@freebsd.org> Sent: Tuesday, August 23, 2005 8:35 PM Subject: Re: Script help using "cut"
> ----- Original Message ----- > From: "Giorgos Keramidas" <[EMAIL PROTECTED]> > To: "antenneX" <[EMAIL PROTECTED]> > Cc: <freebsd-questions@freebsd.org> > Sent: Tuesday, August 23, 2005 8:16 PM > Subject: Re: Script help using "cut" > > > > On 2005-08-23 20:02, antenneX <[EMAIL PROTECTED]> wrote: > > > Been trying to complete a script that I can use to grep spam > emails > > > from the maillog, then trim it to just the plain email address. > Trying > > > to use "cut" in the script but it's not doing what I want yet. > > > > > > Here is what the earlier lines have the lines down to so far: > > > " (envelope-from [EMAIL PROTECTED])" -- no quotes > > > ...and I want this "clean" trimmed result after trim using "cut" > or > > > anything else that works to trim/cut: > > > > > > [EMAIL PROTECTED] <--- no underlines of course > > > > > > That's a TAB space at beginning of the line. > > > > > > The "envelope" lines are in a tmp file in colum format (one line > below > > > the other). > > > (envelope-from [EMAIL PROTECTED]) > > > (envelope-from [EMAIL PROTECTED]) > > > (envelope-from [EMAIL PROTECTED]) > > > > > > All ideas appreciated.... > > > > Does it have to be cut(1)? > > > > $ awk '{print $2}' tmpfile | sed -e 's/)[[:space:]]*$//' | sort | > uniq > > > Just woke up this morning and realized I needed to chop off more -- everything except the domain. So, instead of [EMAIL PROTECTED] I need the result badguy.com How could the above awk line be expanded to chop off the username@ portion as well? Sorry, must have been really tired. _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"