bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Grep problem


From: Bob Proulx
Subject: Re: Grep problem
Date: Thu, 29 Sep 2005 22:22:14 -0600
User-agent: Mutt/1.5.9i

Gummadi, Latha C wrote:
> Why does grep -m option not work. I want to exit after I find n matches
> in a n input file. How can I do this?

The grep -m option works fine.  Starting with such an accusational
tone is not a nice way to start a discussion.  Without further
information I can only guess that you are not using it correctly.
Here is an example of -m use from grep-2.5.1.

  yes | grep -m 3 y
  y
  y
  y

If this is not working for you then please furnish a small example
such as the above illustrating the exact commands that are not
functioning correctly for you.  Include the version of grep that you
are using and the system you are using it on.  The following commands
are useful for gethering this information.

  grep --version
  uname -a

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]