[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

oddity with find -exec grep -i



Perhaps I am looking straight through things, if so, I'm sorry.  I 
have effectively a one liner shell script that I want to run to see 
if any text (typically an Email address) is in any file named "users" 
in any directory below a particular directory, easy I thought:

#!/bin/bash
/usr/bin/find /usr/lib/ecartis/lists/ -name users -print  \
  -exec grep --ignore-case "$1" {} \; | grep -B 1 "$1"

That little file works fine (the original has the second line all in 
one but seemed best to break it for this post).  The only thing is 
that whether I put "--ignore-case" or "-i" it doesn't ignore case.  I 
have a "David.hardy" in one file.  If I search for that it finds it 
perfectly, but if I put "david.hardy", it doesn't.  I've looked at 
man and info and books and I give up and throw myself to the tender 
mercies of the many gurus of this list!  What am I doing wrong?!

Running Debian stable uname -r:
	2.4.18-1-k6
uname -m 
	i586
bash:
	2.05a.0(1)-release (i386-pc-linux-gnu)

TIA

Chris




Reply to: