Web lists-archives.com

Re: An appropriate directory search tool?




On Sunday, October 21, 2018 11:21:35 AM David Wright wrote:
> On Sun 21 Oct 2018 at 10:33:41 (-0400), rhkramer@xxxxxxxxx wrote:
> > On Sunday, October 21, 2018 09:48:28 AM David Wright wrote:
> > > $ grep -L keywordB $(grep -l keywordA a-directory/*extension)
> > 
> > I am not the OP, and I haven't tried this out, but, reading the grep man
> > page for the -L (and the -l) option, I'm a little concerned by the
> > sentence that says ~"Scanning will stop on the first match" -- does that
> > mean it will stop scanning the particular file being scanned, or does
> > that mean it will stop scanning in the directory (or list of files)
> > being scanned?
> 
> Read the full names of the options:
> --files-without-match
> --files-with-matches
>       ↑
> 
> But the fact that scaanning stops can be important. When you get to
> test it out for yourself, try using interactive standard input (-)
> as an input file and you will see the difference when you add -l
> as an option.

Thanks for the reply, and I like that ability to use standard input!

I tried the following, and the output from -L and -l seems almost the same, 
except for that extra line that says "(standard input)" when I use the -l 
option.
 
Any further clarification / clues would be appreciated.

<quote>
rhk@s19:/rhk/ked1$ grep -l test -
one
two
test
(standard input)
rhk@s19:/rhk/ked1$ grep -L test -
test
rhk@s19:/rhk/ked1$ grep -L test -
one
two
test
rhk@s19:/rhk/ked1$ grep -l test -
one
two
test
(standard input)
rhk@s19:/rhk/ked1$
</quote>