can grep use filenames from stdin?

Jan Evert van Grootheest Jan-Evert.van.Grootheest at Vialis.nl
Mon Mar 19 06:16:21 UTC 2007


> On 3/19/07, Thompson Harmon [US], Stanley W. 
> <Stanley.Harmon at sperry.ngc.com> wrote:
> > find . -name \*.c
> > grep -l -e somepattern `!!`
> >
> > The above commands will give you the names of the c files 
> containing 
> > somepattern.
> >
> > Stan
> >
> >
> > -----Original Message-----
> > From: busybox-bounces at busybox.net <busybox-bounces at busybox.net>
> > To: busybox at busybox.net <busybox at busybox.net>
> > Sent: Sun Mar 18 04:06:36 2007
> > Subject: can grep use filenames from stdin?
> >
> > can we make grep get filenames from stdin like:
> >
> > find . -name \*.c | grep -l -e somepattern
> >
> > -
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net 
> > http://busybox.net/cgi-bin/mailman/listinfo/busybox
> >
> >
> 
> yes but xargs will spawn grep for each file and grep will 
> then compile the pattern everytime.
> 
> maybe its better to use some sort of indexing scheme for 
> insanely humongous directories

I don't know about bbox, but on my desktop I'm sure that xargs builds a
commandline that is only limited by the max command line length. So
'find / -name \*.c | grep something' will put lots of filenames on one
commandline.

-- Jan Evert 
 
The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. Vialis is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. 
 



More information about the busybox mailing list