Re: awk usage question
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?
Kevin
Reply to: