From: Oleg Broytman Date: Mon, 26 Jan 2015 06:41:45 +0000 (+0300) Subject: bin/find_*: first check names X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=d711fa89e534b28efa8c95139b852c1210b20c5c;p=dotfiles.git bin/find_*: first check names Name check doesn't require addition stat call. --- diff --git a/bin/find_home_grep.sh b/bin/find_home_grep.sh index dcca1ca..bbf4dc1 100755 --- a/bin/find_home_grep.sh +++ b/bin/find_home_grep.sh @@ -1,4 +1,4 @@ #! /bin/sh cd "$HOME" && exec cgmem_nice 100 \ -find . \( -type d \( -name CVS -o -name .git -o -name .hg -o -name .svn -o -path ./.cache/chromium/\* -o -path ./.cache/mozilla/\* -o -path ./Internet/WWW/htdocs/doc/\* -o -path ./archive/STORE/\* -o -path ./current/Bregis/nobackup/\* -o -path ./media/\* -o -path ./mnt/\*\* \) -prune \) -o -type f -exec grep -I "$@" '{}' \+ 2>/dev/null +find . \( \( -name CVS -o -name .git -o -name .hg -o -name .svn -o -path ./.cache/chromium/\* -o -path ./.cache/mozilla/\* -o -path ./Internet/WWW/htdocs/doc/\* -o -path ./archive/STORE/\* -o -path ./current/Bregis/nobackup/\* -o -path ./media/\* -o -path ./mnt/\*\* \) -type d -prune \) -o -type f -exec grep -I "$@" '{}' \+ 2>/dev/null diff --git a/bin/find_sources.sh b/bin/find_sources.sh index c3111e6..e2ecbea 100755 --- a/bin/find_sources.sh +++ b/bin/find_sources.sh @@ -1,4 +1,4 @@ #! /bin/sh exec cgmem_nice 100 \ -find . \( -type d \( -name CVS -o -name .git -o -name .hg -o -name .svn \) -prune \) -o -type f -print +find . \( \( -name CVS -o -name .git -o -name .hg -o -name .svn \) -type d -prune \) -o -type f -print