X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,KHOP_THREADED,NML_ADSP_CUSTOM_MED,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <34270681.post@talk.nabble.com> Date: Wed, 8 Aug 2012 02:18:00 -0700 (PDT) From: AngusC To: cygwin AT cygwin DOT com Subject: Re: problem using recursive grep (-r option) In-Reply-To: <50213AE5.5010206@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <34266659 DOT post AT talk DOT nabble DOT com> <50213AE5 DOT 5010206 AT gmail DOT com> 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 This works find . -name "*.log" | grep -nH -r "my pattern" *.* marco atzeri-4 wrote: > > On 8/7/2012 5:08 PM, AngusC wrote: >> >> If I use the command: >> >> grep -nH -r "my pattern" *.* >> >> I get results back as expected >> >> But if the file pattern is like this: >> >> grep -nH -r "my pattern" *.log >> >> I get no results back (Even though I have a ton of files with this >> pattern >> with .log file extension). >> >> Am I doing something wrong? >> > > in the second case the "-r" is looking for *.log > file or directories and I guess the directory does not match. > > Try > > find . -name "*.log" -exec grep -nH "my pattern" \{\} \; > > Regards > Marco > > -- > 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 > > > -- View this message in context: http://old.nabble.com/problem-using-recursive-grep-%28-r-option%29-tp34266659p34270681.html Sent from the Cygwin list mailing list archive at Nabble.com. -- 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