grep-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DRAFT: PROPOSAL: Add option 'piped-list' to read file list from stdi


From: Jim Meyering
Subject: Re: DRAFT: PROPOSAL: Add option 'piped-list' to read file list from stdin
Date: Sat, 30 Apr 2022 16:20:02 -0700

On Tue, Apr 26, 2022 at 8:44 AM José Bollo <jobol@nonadev.net> wrote:
> On Tue, 26 Apr 2022 08:27:50 -0700
> Carlo Arenas <carenas@gmail.com> wrote:
>
> > On Tue, Apr 26, 2022 at 8:01 AM José Bollo <jobol@nonadev.net> wrote:
> > > On Tue, 26 Apr 2022 08:32:30 -0600
> > > arnold@skeeve.com wrote:
> > >
> > > > Just use xargs .... :-)
> > >
> > > hum? how?
> >
> > preferably with the -0 option to match a -print0 in your find command
> > so it doesn't break because of files with spaces.
>
> > FWIW pcre2grep provides a --file-list parameter that does this.
>
> Good hints, thank you
>
> It advocates for adding a such option to grep.

Thanks for the suggestion, but we cannot justify
adding such an option when using standard Unix idioms,
one can gain the same effect by running a command like this:

  find . ... -print0 | xargs -0 grep ...

or if you have a list of newline-separated file names in a file named
FILES, run this:

  tr '\n' '\0' < FILES | xargs -0 grep ...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]