[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: awk usage question



on Thu, May 29, 2003 at 10:52:50PM -0400, Kevin McKinley (ronin2@bellatlantic.net) wrote:
> On Thu, 29 May 2003 22:00:28 -0400
> David Z Maze <dmaze@debian.org> wrote:
> 
> > Kevin Coyner <kevin@rustybear.com> writes:
> > 
> > > I'm trying to filter a file from tcpdump (actually tethereal) using awk,
> > > but am stuck in one spot.
> > >
> > > In words, what I'd like to do is:
> > >
> > >     1.  only read lines with the word "Message" in it
> > >     2.  in lines with "Message", output everything to the right of the
> > >         word "Message".  This could be one word or twenty words.
> > 
> > I'd do this with sed, not awk:
> > 
> >   sed -ne 's/.*Message//p'
> > 
> > (By default, don't print lines [-n]; use an expression [-e] that
> > replaces an arbitrary number of characters followed by the word
> > "Message" with nothing, and print the result.)
> 
> Won't this print all lines, and delete the word "Message" where it appears?

1. No.

2. Try it and see.

Peace.

-- 
Karsten M. Self <kmself@ix.netcom.com>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
   Geek for hire:  http://kmself.home.netcom.com/resume.html



Reply to: