[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with grep -vl
From: |
Andreas Schwab |
Subject: |
Re: problem with grep -vl |
Date: |
Tue, 25 Nov 2008 00:03:57 +0100 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux) |
Mark Perry <address@hidden> writes:
> In the 2nd example the "grep -vl" locates _ALL_ files because the
> previously matching string in not in the first line of any of the files.
> Note that it again lists files ending 0600,0700,0800 even though we know
> from example 1 that these files _DO_ contain the match string.
>
> I know that "-l" is suppose to stop on the first match, but when combined
> with "-v" should it not search all lines for a possible match?
"-v" tells grep to look for lines that do _not_ match the pattern.
Since every one of your files contains such a line, they are all
considered matching files wrt. "-l". You probably want "-L" instead.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."