delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/11/18:01:21

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <080101c07c22$2cf28f00$48a80241@glstnbry1.ct.home.com>
From: "MarK Stucky" <mstucky5 AT home DOT com>
To: <cygwin AT cygwin DOT com>
References: <3A5E2779 DOT 29738 DOT E908D08 AT localhost> <3A5E274E DOT C57D2FD2 AT yahoo DOT com> <20010111165405 DOT B5955 AT volta DOT certicom DOT com>
Subject: Re: Recursive grep [WAS: Re: date]
Date: Thu, 11 Jan 2001 17:59:38 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200

----- Original Message ----- 
From: Ashok Vadekar <avadekar AT certicom DOT com>
To: <cygwin AT cygwin DOT com>
Sent: Thursday, January 11, 2001 4:54 PM
Subject: Re: Recursive grep [WAS: Re: date]


> On Thu, Jan 11, 2001 at 04:36:14PM -0500, Earnie Boyd wrote:
> > find . -name \*.cc -exec echo '{}' ';' -exec grep getenv '{}' ';'
> Or with fewer keystrokes:
> find . -name \*.cc -print -exec grep getenv '{}' ';'
> 
> --

If you put the "-print" at the end, it will then only
print the file name of files in which grep finds a match

For example, from bash, try

   find . -name '*.c' -exec grep getenv {} \; -print

Just my $0.02

--Mark



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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