Browse Source

update s function

pull/1/head
10sr 11 years ago
parent
commit
aabb6eebcd
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      bashrc

+ 8
- 4
bashrc View File

@@ -368,15 +368,19 @@ s(){
ack --pager="$PAGER" "$@" ack --pager="$PAGER" "$@"
else else
echo \ echo \
">> grep -nH --color=always" \
"--exclude=\'.svn/\*\' --exclude=\'.git/\*\'" \
"$@" "-r ." 1>&2
">> find . " \
"-path '*/.git' -prune -o" \
"-path '*/.svn' -prune -o" \
"-type f -exec grep -nH -e --color=always $@ {} +" 1>&2
if test $# -eq 0 if test $# -eq 0
then then
echo "No search word given." 1>&2 echo "No search word given." 1>&2
return 1 return 1
fi fi
grep -nH --color=always --exclude='.svn/*' --exclude='.git/*' "$@" -r . \
find . \
-path '*/.git' -prune -o \
-path '*/.svn' -prune -o \
-type -f -exec grep -nH -e --color=always "$@" {} + \
| $PAGER | $PAGER
fi fi
} }


Loading…
Cancel
Save