X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 4 Jun 2009 13:43:52 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: grep -f option is not working in release of grep (2.5.3-1) Message-ID: <20090604174352.GA753@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <3046a3400906040003iaf36181i691a35e115d4524a AT mail DOT gmail DOT com> <0105D5C1E0353146B1B222348B0411A201BCE5EB42 AT NIHMLBX02 DOT nih DOT gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0105D5C1E0353146B1B222348B0411A201BCE5EB42@NIHMLBX02.nih.gov> User-Agent: Mutt/1.5.19 (2009-01-05) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Thu, Jun 04, 2009 at 12:13:08PM -0400, Buchbinder, Barry (NIH/NIAID) [E] wrote: >Tulasi Ram wrote on Thursday, June 04, 2009 3:04 AM: >> In the latest release of grep (2.5.3-1), the -f option (read search >> patters from a file) is not working for me. I have tried to search by >> providing pattern file. >> >> I have tried by using below command. It didn?t work. >> >> grep -F -B 10 -A 0 -f FindDeploymentErrors_Error.txt CM_Setup2.log > >If your patterns end with "$" to anchor to the end of a line, and one >file has DOS/Windows line endings (\r\n) while the other has unix line >endings (\n), the patterns will not match. > >See what the following says. >$ file DeploymentErrors_Error.txt CM_Setup2.log That wouldn't precisely be an issue when using the -F option: -F, --fixed-strings Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. (-F is specified by POSIX.) However, it is a good point nonetheless since, if the .txt file contains \r\n line endings the \r may be interpreted incorrectly. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/