public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Wildcard problem with recursion
@ 2003-10-23 10:05 Ajith Kumar
  2003-10-23 12:54 ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: Ajith Kumar @ 2003-10-23 10:05 UTC (permalink / raw)
  To: cygwin

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?

Regards,
ajith



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Wildcard problem with recursion
  2003-10-23 10:05 Wildcard problem with recursion Ajith Kumar
@ 2003-10-23 12:54 ` Corinna Vinschen
  2003-10-24 10:47   ` Andy Rushton
  2003-10-25 10:03   ` Ajith Kumar
  0 siblings, 2 replies; 6+ messages in thread
From: Corinna Vinschen @ 2003-10-23 12:54 UTC (permalink / raw)
  To: cygwin

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

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Wildcard problem with recursion
  2003-10-23 12:54 ` Corinna Vinschen
@ 2003-10-24 10:47   ` Andy Rushton
  2003-10-25 10:17     ` Ajith Kumar
  2003-10-25 10:03   ` Ajith Kumar
  1 sibling, 1 reply; 6+ messages in thread
From: Andy Rushton @ 2003-10-24 10:47 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Wildcard problem with recursion
  2003-10-23 12:54 ` Corinna Vinschen
  2003-10-24 10:47   ` Andy Rushton
@ 2003-10-25 10:03   ` Ajith Kumar
  2003-10-25 16:54     ` Hannu E K Nevalainen
  1 sibling, 1 reply; 6+ messages in thread
From: Ajith Kumar @ 2003-10-25 10:03 UTC (permalink / raw)
  To: cygwin

I run these from the win2k cmd.exe and not from the bash prompt. Can u be
more specific please to which doc or man pages I shold refer to?
Thank You
Regards,
ajith

-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
Of Corinna Vinschen
Sent: Thursday, October 23, 2003 3:44 PM
To: cygwin@cygwin.com
Subject: Re: Wildcard problem with recursion


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

Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

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



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Wildcard problem with recursion
  2003-10-24 10:47   ` Andy Rushton
@ 2003-10-25 10:17     ` Ajith Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Ajith Kumar @ 2003-10-25 10:17 UTC (permalink / raw)
  To: 'Andy Rushton', cygwin



-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
Of Andy Rushton
Sent: Friday, October 24, 2003 2:32 PM
To: cygwin@cygwin.com
Subject: Re: Wildcard problem with recursion


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??'` ------------------------------ 1

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

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

****************************************************************************
********

The command 2 works fine. However 1 fails revereting to my original problem.
If I execute the find command alone I get

D:\views\aj_pvt\Tally63>find . -name '*.h??'
File not found - '*.h??'

or

D:\views\aj_pvt\Tally63>find . -name *.h??
File not found - *.h??

I did n't reply my previous cygwin installation. As u see I  use the Win2k
cmd prompt

Regards,
ajith




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



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Wildcard problem with recursion
  2003-10-25 10:03   ` Ajith Kumar
@ 2003-10-25 16:54     ` Hannu E K Nevalainen
  0 siblings, 0 replies; 6+ messages in thread
From: Hannu E K Nevalainen @ 2003-10-25 16:54 UTC (permalink / raw)
  To: cygwin

> From: Ajith Kumar
> Sent: Saturday, October 25, 2003 7:59 AM

> > Yes, read the shell man pages to learn how file completion works.
> > What you want is a job for `find | xargs grep'.
> >
> > Corinna

> I run these from the win2k cmd.exe and not from the bash prompt.
> Can u be more specific please to which doc or man pages I shold
> refer to?
> Thank You
> Regards,
> ajith

$ info bash # bash shell info pages (hypertext)
 (some man pages are updated less requently than info pages)
$ info find
$ info xargs

In most cases you can replace "info" with "man" - but note that man pages
often are less frequently updated.

If
	$ type -a <command>
says "Internal command" then
	$ help <command>
usually tells more.

Though you might find it easier to find relevant parts of the text by using
less's "/" key to search for interesting text in the _man_ pages  (this
works in the info pages too, but is less succesful IMO)

/Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E
-- printf("Timezone: %s\n", (DST)?"UTC+02":"UTC+01"); --
--END OF MESSAGE--


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-10-25 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-23 10:05 Wildcard problem with recursion Ajith Kumar
2003-10-23 12:54 ` Corinna Vinschen
2003-10-24 10:47   ` Andy Rushton
2003-10-25 10:17     ` Ajith Kumar
2003-10-25 10:03   ` Ajith Kumar
2003-10-25 16:54     ` Hannu E K Nevalainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).