Date: Tue, 23 Aug 2005 20:26:17 -0500 From: "antenneX" <antennex@swbell.net> To: "Giorgos Keramidas" <keramida@ceid.upatras.gr> Cc: freebsd-questions@freebsd.org Subject: Re: Script help using "cut" Message-ID: <041301c5a84a$d431ffe0$0200000a@SAGEAME> References: <040a01c5a847$7a0353f0$0200000a@SAGEAME> <20050824011632.GA6103@gothmog.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- From: "Giorgos Keramidas" <keramida@ceid.upatras.gr> To: "antenneX" <antennex@swbell.net> 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 <antennex@swbell.net> 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 spammer@badguy.com)" -- no quotes > > ...and I want this "clean" trimmed result after trim using "cut" or > > anything else that works to trim/cut: > > > > spammer@badguy.com <--- 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 spammer@badguy.com) > > (envelope-from spammer2@badguy2.com) > > (envelope-from spammer3@badguy3.com) > > > > All ideas appreciated.... > > Does it have to be cut(1)? > > $ awk '{print $2}' tmpfile | sed -e 's/)[[:space:]]*$//' | sort | uniq > No, it doesn't have to be "cut." I'll give this a try... Thanks and, Best regards, Jack L. Stone > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?041301c5a84a$d431ffe0$0200000a>