TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:21649] Limits of grep?
On Tue, Sep 26, 2000 at 09:23:51AM -0500, Adam Maloney wrote:
> The shell expands the *, not grep. You want to use either xargs or a
> script:
>
> for file in `ls -1`
> do
> grep "string" $file
> done
>
> xargs is really the solution though, check the manual.
>
I think it would just be
find . -type f | xargs grep pattern
Where pattern is what you're searching for. Though, I'm not sure if the
shell will complain about this or not, but I don't think so. If I had a
dir with 10000 files in it, I'd let you know for sure :)
Gabe
--
--------------------------------------------------------------------------------
Gabe Turner | X-President,
UNIX Systems Administrator, | Assoc. for Computing Machinery
U of M Supercomputing Institute for | Univerisity of Minnesota
Digital Simulation and Advanced Computation | dopp@acm.cs.umn.edu
"My dinosaur droppings! Painted like Easter eggs!"
- Ren Hoek in "Sven Hoek"
--------------------------------------------------------------------------------