On Sunday, October 21, 2018 12:35:04 PM David Wright wrote:
> On Sun 21 Oct 2018 at 11:45:49 (-0400), rhkra...@gmail.com wrote:
> > Any further clarification / clues would be appreciated.
> 
> Use neither option to see the difference with using either -l or -L.
> So that standard output doesn't clutter the output, I suggest
> redirecting it thus:
> 
> $ grep test - >| /tmp/a ; echo "and the output is" ; cat /tmp/a
> 
> Then you will see the difference when you add -l as an option.

Ok, thanks again, to you and Curt!

I see the difference, but it may take a little while for it to really soak in 
(and / or to recognize a use / need for it (for me)), but I guess I learned 
something ;-)

It sort of looks like that, with the -l option, if there were additonal files 
that also had matches, I might have to restart the command to find others, but, 
I'm not sure of that, and I guess I'd have to run a more extensive  test to 
confirm that, like creating at least two files with matches and put them in a 
directory (probably with some other files that don't match).

I'm not ready to do that at the moment, so I'll leave it there for now.

(And, I doubt there's a way to run the same command using standard input twice 
(e.g., something like grep test - - ...).)

For anyone else who is interested, my tests are shown below:

<quote>
rhk@s19:/rhk/ked1$ grep test - >| /tmp/a ; echo "and the output is" ; cat 
/tmp/a
one
two
test
one
two
test
^C
rhk@s19:/rhk/ked1$ less  /tmp/a
rhk@s19:/rhk/ked1$ grep -l test - >| /tmp/a ; echo "and the output is" ; cat 
/tmp/a
one
two
test
and the output is
(standard input)
rhk@s19:/rhk/ked1$ grep -L test - >| /tmp/a ; echo "and the output is" ; cat 
/tmp/a
one
two
test
and the output is
rhk@s19:/rhk/ked1$ 
</quote>

Reply via email to