delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/24/05:02:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <3F98EA87.3090109@ecs.soton.ac.uk>
Date: Fri, 24 Oct 2003 10:01:59 +0100
From: Andy Rushton <ajr1 AT ecs DOT soton DOT ac DOT uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007
X-Accept-Language: en, en-us
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Wildcard problem with recursion
References: <000301c39949$0dc87850$9c01a8c0 AT shakti DOT tallysolutions DOT com> <20031023101419 DOT GA1653 AT cygbert DOT vinschen DOT de>
In-Reply-To: <20031023101419.GA1653@cygbert.vinschen.de>
Note-from-DJ: This may be spam

Corinna Vinschen wrote:

>On Thu, Oct 23, 2003 at 03:05:53PM +0530, Ajith Kumar wrote:
>  
>
>>Cygwin utilities like grep or ls with -R options doesn't seem to be working.
>>egs when I say
>>    
>>
>>>grep -r FLD_DCT_STRING  *.h??
>>>      
>>>
>>I get
>>grep: *.hpp: No such file or directory
>>
>>However there are many .h, .hxx and .hpp files in the subdirectories
>>
>>ls also gives the same err.
>>
>>Any solutons?
>>    
>>
>
>Yes, read the shell man pages to learn how file completion works.
>What you want is a job for `find | xargs grep'.
>  
>
Thanks for the xargs tip Corinna - thats a new one on me.

an alternative (talking to original poster here) is:

grep FLD_DCT_STRING `find . -name '*.h??'`

Or you can search *directories* recursively with grep, but this doesn't 
allow you to filter the file type. e.g.:

grep -r FLD_DCT_STRING .

where '.' is the current directory - this will search all files in 
subdirectories too. See 'info grep'.

Andy
-- 
Andy Rushton, Research Fellow, School of ECS, Southampton University
address: rm 3053, Mountbatten Building (53)
phone: 023 8059 6665
http://www.ecs.soton.ac.uk/~ajr1



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