X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org MIME-Version: 1.0 X-Received: by 10.180.101.99 with SMTP id ff3mr644076wib.21.1360097701831; Tue, 05 Feb 2013 12:55:01 -0800 (PST) In-Reply-To: <9E285A913B6C6B4797EBAB83675F80D9058F95@NHC0EX52.goodrich.root.local> References: <9E285A913B6C6B4797EBAB83675F80D9058F95 AT NHC0EX52 DOT goodrich DOT root DOT local> Date: Tue, 5 Feb 2013 12:55:01 -0800 Message-ID: Subject: Re: Problem with Cygwin 1.7.17 + Bash and Grep... From: Alan Thompson To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 Never heard of pspad, but I use Cygwin's dos2unix all the time for this kind of thing. Alan Thompson On Tue, Feb 5, 2013 at 6:49 AM, Gates, Roger wrote: > > > >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 > > File-a.txt must be in DOS format. Try this. > > for i in `cat file-a.txt | d2u`; do echo $i; > grep $i file-b.txt; done > alpha > beta > charlie > charlie,13 > delta > echo > > Roger > > > > -- > 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 > -- 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