bug-grep
[Top][All Lists]
Advanced

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

Re: -f doesn't work?


From: Bob Proulx
Subject: Re: -f doesn't work?
Date: Fri, 23 May 2008 19:55:05 -0600
User-agent: Mutt/1.5.13 (2006-08-11)

John Pyrce wrote:
> I installed the latest version of cygwin, and now using patterns from a
> file via "grep -f filename" doesn't work.  It's hard to believe that
> this would be broken, but I can't see anything that I'm doing wrong
> either.  Any thoughts?

"Doesn't work" is a little vague.  Can you give us an example?  Then
we could say if it works or not.

To pre-emptively respond, -f is as the documentation says:

       -f FILE, --file=FILE
              Obtain patterns from FILE, one per line.  The  empty  file  con-
              tains zero patterns, and therefore matches nothing.

Therefore an example (using GNU syntax) would be:

  $ echo oo > patternfile
  $ echo foo > datafile
  $ grep -f patternfile datafile
  foo

You would need to adapt that for your Cygwin system but I assume you
know it better than I do since I do not know it very well.

Bob




reply via email to

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