for i in "$@"
if [ $first = 0 ]; then
echo -ne "$argstr" | xargs -0 egrep -nr | egrep -v '~:[0-9]+:|^Binary file'
I suppose the caveat is that if you program in a language where constructs matching ~:[0-9]+: are legal this could filter out some source. Entering stream-of-consciousness... Of course, even in C/C++ they're legal within strings. Hm. Filtering the output like that to filter files is brain-dead, using find to filter files up front would be better... but then you'd hit the command-line length limit... I bet someone has written a tool for this... probably using Perl... Leaving stream-of-consciousness
Indeed, there is ack. And, of course, it's in Perl. It is way better than my little bash hack.
EDIT: It turns out that I totally missed missed two options to GNU grep that would have saved me the trouble of writing anything but an alias: -I (short for --binary-files=without-match) and --exclude='*~' to get rid of those vim files. At least I got to learn how xargs works.