2 handy scripts

Matt Dillon posted 2 scripts he finds handy for searching in the source tree. The first one is used on its own, with the argument being the search target:

#!/bin/csh
#
# /usr/local/bin/search
find . -type f -and -not -name '*.*o' -and -not -name '*.a' -and -not -name '*.kld' | fgrep -v ./compile | xargs egrep "$argv" | egrep -v 'Binary'

And the other script, used to pull files containing the searchterm into an editor like so: ‘vi `pullout searchterms`’

#!/bin/csh
#
# /usr/local/bin/pullout
/usr/local/bin/search $argv | awk -F : '{ print $1; }' | sort | uniq