From 0632bf184ae47a7f4a7aa48feff61463528e3dcc Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 29 Aug 2012 13:32:42 +0200 Subject: [PATCH] [script] add different find function --- scripts/find-nosvn | 53 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/scripts/find-nosvn b/scripts/find-nosvn index 72e2eec..bfd6eee 100755 --- a/scripts/find-nosvn +++ b/scripts/find-nosvn @@ -6,6 +6,57 @@ echo -e "${txtRED}searching for $@${txtdfl}"; #find . -not -iwholename "*.svn" -name "*.[ch]" -exec grep -nH --color=auto $@ {} \; -find . -type d -a -name .svn -prune -o -name "*.[ch]" | xargs grep -nH --color=always "$@" +find . -type d -a -name .svn -prune -o -name "*.[ch]" | xargs grep -nH --color=always "$@" #find . -name "*.[ch]" -exec grep -nH --color=auto --exclude-dir=.svn $@ {} \; #try ack + +function fbisp () { +find . -type d -name "products" -prune -o -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.py" -print | xargs /bin/grep -i -n $1 | /bin/grep -iv matches +} +# find base inside products +function fbip () { +find . -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.py" -print | xargs /bin/grep -i -n $1 | /bin/grep -iv matches +} +# find base source products +function fbsp () { +find . -type d -name "products" -prune -o -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.py" -print | /bin/grep -i $1 | /bin/grep -iv matches +} +# find base products +function fbp () { +find . -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.py" -print | /bin/grep -i $1 | /bin/grep -iv matches +} + +# find base inside sources C [.c/.h] +function fbisc () { +find . -type d -name "products" -prune -o -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.[ch]" -print | xargs /bin/grep -i -n $1 | /bin/grep -iv matches +} +# find base inside C +function fbic () { +find . -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.[ch]" -print | xargs /bin/grep -i -n $1 | /bin/grep -iv matches +} +# find base sources C +function fbsc () { +find . -type d -name "products" -prune -o -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.[ch]" -print | /bin/grep -i $1 | /bin/grep -iv matches +} +# find base C +function fbc () { +find . -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -name "*.[ch]" -print | /bin/grep -i $1 | /bin/grep -iv matches +} + +# find base inside sources +function fbis () { +find . -type d -name "products" -prune -o -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -print | xargs /bin/grep -i -n $1 | /bin/grep -iv matches +} +# find base inside +function fbi () { +find . -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -print | xargs /bin/grep -i -n $1 | /bin/grep -iv matches +} +# find base sources +function fbs () { +find . -type d -name "products" -prune -o -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -print | /bin/grep -i $1 | /bin/grep -iv matches +} +# find base +function fb () { +find . -type d -name "\.svn" -prune -o -name "%*" -prune -o -type f -print | /bin/grep -i $1 | /bin/grep -iv matches +} +