Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 425bc22a authored by Tim Monahan-Mitchell's avatar Tim Monahan-Mitchell Committed by Steve Kondik
Browse files

envsetup.sh : Add more grep commands

hgrep, mkgrep, rcgrep, shgrep

Change-Id: Ic99f17742fe9a451a0da092fad7b232915a2d883
parent 0ec41ee0
Loading
Loading
Loading
Loading

envsetup.sh

100644 → 100755
+24 −0
Original line number Diff line number Diff line
@@ -6,8 +6,12 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
- mm:      Builds all of the modules in the current directory.
- mmm:     Builds all of the modules in the supplied directories.
- cgrep:   Greps on all local C/C++ files.
- hgrep:   Greps on all local C/C++ header files.
- jgrep:   Greps on all local Java files.
- mkgrep:  Greps on all local make files.
- rcgrep:  Greps on all local .rc files.
- resgrep: Greps on all local res/*.xml files.
- shgrep:  Greps on all local .sh files.
- godir:   Go to the directory containing a file.

Look at the source to view more functions. The complete list is:
@@ -812,11 +816,31 @@ function jgrep()
    find . -type f -name "*\.java" -print0 | xargs -0 grep --color -n "$@"
}

function mkgrep()
{
    find . -type f -name "*\.mk" -print0 | xargs -0 grep --color -n "$@"
}

function rcgrep()
{
    find . -type f -name "*\.rc" -print0 | xargs -0 grep --color -n "$@"
}

function shgrep()
{
    find . -type f -name "*\.sh" -print0 | xargs -0 grep --color -n "$@"
}

function cgrep()
{
    find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 grep --color -n "$@"
}

function hgrep()
{
    find . -type f -name "*\.h" -print0 | xargs -0 grep --color -n "$@"
}

function resgrep()
{
    for dir in `find . -name res -type d`; do find $dir -type f -name '*\.xml' -print0 | xargs -0 grep --color -n "$@"; done;