Yes, I have this one terrible drawback - I tend to tell people who seek help where
they can get help, instead of actually doing all their work for them (thus
increasing the chances they will require help again).

I hold it as a poll to the community whether specifying exact command lines is
prefable to saying "You may want to tweak the grep parameters a little to get the
results exactly the way you want them."

In my view, this list is for people who are stuck and need help finding the right
direction, not for people who are lazy, and want their work done for them. Of
course, this is my personal view. Others are welcome to have their own opinion.

                        Shachar

P.S.
    I am not offended by Oleg's, or anyone else's for that matter, comments. I
just got feedback saying that my responses are quick, but shallow, and wanted to
explain why. This view I have of the purpose of this list may also be wrong.

            Sh.


Oleg Goldshmidt wrote:

> Herouth Maoz <[EMAIL PROTECTED]> writes:
>
> > Gavrie Philipson wrote:
> > >
> > > Subba Rao wrote:
> > > >
> > > > I have a directory of 10000+ text files and would like to search for
> > > > some strings in these files. When I tried using "grep" command with an
> > > > asterisk, I get the error message somthing to the effect,
> > > >
> > > >         "File argument list too long"
> > > >
> > >
> > > Besides Shachar's answer about using 'find', you could also use the
> > > 'xargs' command. In this case, 'ls | xargs grep <pattern>' should do the
> > > trick.
> >
> > And it would also do what was originally intended. Using 'find' will go
> > recursively into subdirectories. If one was able to use grep *, no recursion
> > would be performed.
>
> Some  comments that were omitted in the thread so far.
>
> 1) You can use find without descending into subdirectories (perusing
>    the documentation is left as an exercise to the reader).
>
> 2) I believe that find | xargs (or ls | xargs) has an advantage over
>    Shachar's suggestion in that the latter will spawn 10000+ grep
>    processes.
>
> 3) An additional benefit of xargs will be that grep will show you the
>    file name for each match, while in Shachar's variant each grep will
>    be run on just one file and the file name will not be there by
>    default (yes, you can use --with-filename option, a.k.a. -H).
>
> --
> Oleg Goldshmidt <[EMAIL PROTECTED]>
> "... We work by wit, and not by witchcraft;
>  And wit depends on dilatory time." [Shakespeare]
>
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to