delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/02/04/16:06:27

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
From: "Nellis, Kenneth" <Kenneth DOT Nellis AT xerox DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: RE: Problem with Cygwin 1.7.17 + Bash and Grep...
Date: Mon, 4 Feb 2013 21:06:11 +0000
Message-ID: <0D835E9B9CD07F40A48423F80D3B5A7005DDAD@USA7109MB022.na.xerox.net>
References: <CAAoqyza3HaVrXFt+mAJWzjH=hjmz-0H0HtCCwK_1_qk4HoT=sw AT mail DOT gmail DOT com>
In-Reply-To: <CAAoqyza3HaVrXFt+mAJWzjH=hjmz-0H0HtCCwK_1_qk4HoT=sw@mail.gmail.com>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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 r14L6MfF028356

-----Original Message-----
From: Vladimir Morales 

Tried google and found similar, but not the exact issue I'm seeing.
I'm running Windows 7 and trying to run a simple bash one-liner using
grep:

[vmorales AT D630-Vmorales ~]# uname -a
CYGWIN_NT-6.1-WOW64 D630-Vmorales 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin


I'm essentially trying to take the contents of one file, and use it as
input for a grep command against another file, but I do not get any
results, even though I know the 2nd file contains a match.  In the
one-liner below, I include an "echo" to confirm the output is in the
variable that should be used with the grep command.

[vmorales AT D630-Vmorales ~]# for i in `cat file-a.txt`; do echo $i;
grep $i file-b.txt; done
alpha
beta
charlie
delta
echo

[vmorales AT D630-Vmorales ~]# grep charlie file-b.txt
charlie,13


This is pretty straight-forward and can't think of what I may be
missing here.  Any suggestions would be appreciated.

Vlad
-----End Original Message-----

Maybe file-a.txt contains CRLF line endings?
--Ken Nellis

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


- Raw text -


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