四时宝库

程序员的知识宝库

把cgrep mgrep集成到bashrc(中原证券集成版下载官方网站)


把cgrep mgrep集成到bashrc

https://android.googlesource.com/platform/build/+/android-4.4.3_r1/envsetup.sh

在~/.bashrc里面增加

#Android tool
function cgrep()
{
 find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 grep --color -n "$@"
}
function mgrep()
{
 find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -type f -print0 | xargs -0 grep --color -n "$@"
}

find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.prop' -o -name '*.mk' -o -name '*.sh' -o -name '*.js' -o -name '*.json' \) -print0 | xargs -0 grep --color -n "$@"

发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言
    友情链接