[zsh] more grep function
This commit is contained in:
parent
2c78121c1e
commit
fb60eb255f
@ -21,7 +21,7 @@ alias xte='nohup xterm &' # xte lancera un xterm qui ne se fermera pas si on fer
|
|||||||
alias minicom='minicom -c on'
|
alias minicom='minicom -c on'
|
||||||
alias vims='vim --servername vimserver'
|
alias vims='vim --servername vimserver'
|
||||||
alias vimo='vim --servername vimserver --remote-tab'
|
alias vimo='vim --servername vimserver --remote-tab'
|
||||||
alias agrep='grep --exclude=.git --exclude-dir=out --exclude-dir=prebuilts --exclude-dir=docs'
|
alias agrep='grep --exclude=.git --exclude-dir=out --exclude-dir=prebuilts --exclude-dir=docs --exclude=tags --exclude=cscope.out'
|
||||||
|
|
||||||
#Extension Alias
|
#Extension Alias
|
||||||
alias -s html=$BROWSER
|
alias -s html=$BROWSER
|
||||||
|
@ -110,11 +110,25 @@ resgrep () {
|
|||||||
for dir in `find . -name .repo -prune -o -name .git -prune -o -name res -type d`
|
for dir in `find . -name .repo -prune -o -name .git -prune -o -name res -type d`
|
||||||
do
|
do
|
||||||
find $dir -type f -name '*\.xml' -print0 | xargs -0 grep --color -n "$@"
|
find $dir -type f -name '*\.xml' -print0 | xargs -0 grep --color -n "$@"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
gettop ()
|
sgrep() {
|
||||||
{
|
find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cc|cpp|S|java|xml|sh|mk|aidl)' -print0 | xargs -0 grep --color -n "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
mangrep() {
|
||||||
|
find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -type f -name 'AndroidManifest.xml' -print0 | xargs -0 grep --color -n "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
sepgrep() {
|
||||||
|
find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -name sepolicy -type d -print0 | xargs -0 grep --color -n -r --exclude-dir=\.git "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gettop ()
|
||||||
|
{
|
||||||
local TOPFILE=build/core/envsetup.mk;
|
local TOPFILE=build/core/envsetup.mk;
|
||||||
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ]; then
|
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ]; then
|
||||||
echo $TOP;
|
echo $TOP;
|
||||||
|
Loading…
Reference in New Issue
Block a user