grep and the -f switch

Roy Jensen R.Jensen@consol.ca
Mon Nov 26 20:15:00 GMT 2012


The issue is the text format. Windows is \r\n; Unix is \n.
I used Notepad++ to save in Unix text format and everything worked
fine.

Sigh...should have thought of that before. 

Roy Jensen
	-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
	*** Imagination is more important than knowledge. (Einstein)
	=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


On Mon, 26 Nov 2012 12:08:54 -0700, you wrote:

>I've created a text file (in Windows) with the text patterns I wish to
>search for. Using the -f switch, grep only searches for the last
>pattern in the file. If there is a blank line at the end, grep finds
>nothing.
>
>grep -a -A 4 -f pattern.txt my.file > output.txt
>
>Any suggestions to get this to work?
>
>Thanks,
>Roy Jensen
>
>Roy Jensen
>	-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>	*** Imagination is more important than knowledge. (Einstein)
>	=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list