-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrgr
executable file
·40 lines (33 loc) · 1.05 KB
/
rgr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Recursive grep that avoids .svn, .git, garbage and obvious binary files.
if [ ! -f ~/bin/rgr ] ; then
echo 'Installing rgr into ~/bin/'
if [ ! -d ~/bin/ ] ; then
mkdir -v ~/bin/
fi
if [ "$0" == "bash" ] ; then
# Get the file from the web
curl -o ~/bin/rgr rgr.lr2.com
else
# Try a local?
cp -v "$0" ~/bin/
fi
if [ -f ~/bin/rgr ] ; then
chmod 774 ~/bin/rgr
echo "Install of ~/bin/rgr succeeded."
else
echo "Install FAILED."
fi
exit
fi
find -regextype posix-egrep \
'(' -type d -name '.git' -prune ')' -or \
'(' -type d -name '.svn' -prune ')' -or \
'(' -type d -name 'cache' -prune ')' -or \
'(' -type d -name 'csv' -prune ')' -or \
'(' -type d -name 'media' -prune ')' -or \
'(' -type d -name 'session' -prune ')' -or \
-type f \
-not -regex '.*\.(dot|gif|ico|jpeg|jpg|mid|pdf|pem|plc|psd)$' \
-not -regex '.*\.(ptc|pty|pyc|pyo|tif|tiff|ttf|vsd|xcf|xls)$' \
-exec grep -H -n --color -E "$@" {} ';'