Re: Using grep
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Mon, 27 Feb 2006 14:59:50 -0500
On 2006-02-27, Fernando Rodríguez wrote:
Hi,
How can I make grep return all the files that do NOT match a given pattern?
Files do not match (or NOT match) a pattern; lines within the file
do (or do not).
I'd like to have a list f all files that do NOT contain the text "addCookies".
for file in *
do
grep "addCookies" "$file" > /dev/null 2>&1 || printf "%s\n" "$file"
done
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.
- References:
- Using grep
- From: Fernando Rodríguez
- Using grep
- Prev by Date: Re: Using grep
- Next by Date: patching RPMs
- Previous by thread: Re: Using grep
- Next by thread: Re: Using grep
- Index(es):