<div class="gmail_quote">On Tue, Jan 26, 2010 at 4:32 PM, Todd Walton <span dir="ltr"><<a href="mailto:tdwalton@gmail.com">tdwalton@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
gnu grep(1) 2.5.1-cvs says:<br>
<br>
-l, --files-with-matches<br>
Suppress normal output; instead print the name of each input<br>
file from which output would<br>
normally have been printed. The scanning will stop on the<br>
first match. (-l is specified by<br>
POSIX.)<br>
<br>
So when I do 'grep string *.txt' am I going to get back every file<br>
that has string in it? Or is it literally going to stop on the first<br>
match?<br>
<br>
It returns every file. It stops searching each particular file on the<br>
first match, and then moves on to the next file. It's ambiguous<br>
wording.<br>
<font color="#888888"><br></font></blockquote></div><br>I use -l (that's lower case L) all the time. It prints each file name that has at least one line that matches the regex. Each file name is on a separate line.<br clear="all">
<br>-- <br>Matthew Nuzum<br>newz2000 on freenode, skype, linkedin, <a href="http://identi.ca">identi.ca</a> and twitter<br>