delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/16/10:39:14

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <8834A84C87A2C148AD46921BB8BFC97C047997EF AT S1SE1MAIL DOT emea1 DOT ad DOT group>
Subject: RE: grep -f problem
Date: Mon, 16 Jul 2007 15:38:51 +0100
Message-ID: <014901c7c7b7$072ed200$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <8834A84C87A2C148AD46921BB8BFC97C047997EF@S1SE1MAIL.emea1.ad.group>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l6GEd31x006340

On 16 July 2007 15:12, Mårten Gustafsson wrote:

> Hi
> 
> I have a problem with grep -f. Here is my example script:
> 
> #!sh
> echo -e "calvin\nhobbes" > expressions.txt
> echo -e "calvin chases\nhis favourite imaginary friend\nhobbes" > text.txt
> grep -f expressions.txt text.txt
> 
> The output is:
> $ grepbug.sh
> hobbes
> 
> The expected output:
> 
> C:\UnxUtils\usr\local\wbin>sh grepbug.sh
> calvin chases
> hobbes
> 
> I am not very familiar with unix or cygwin. Is there a kind soul to verify
> that this is really a problem by running the scrip on a true unix? 

  I can do better: I can verify it's Not A Bug by running the script on cygwin
and seeing that it works fine.  On the other hand, if I get the script to run
"unix2dos" on 'expressions.txt' and 'text.txt' before grepping them, I get the
result you were expecting.  

  Are you on a textmode mount or something?  Or do you perhaps have some dos
line-endings in the grepbug script file itself?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019