cgrep

Posted 2012.01.27 10:57
#!/bin/bash

function usage()
{
   echo 'cgrep grep pattern from *.[chSs] or *.cpp or *.hpp or *.mk or [Mm]akefile'
}

if [ $# -eq 0 ]; then
    usage
    exit 1
fi
 
find . -type f -name "*.[chSs]" -o -name "*.cpp" -o -name "*.hpp" -o -name "*.mk" -o -name "[Mm]akefile" | xargs grep --color=auto -n "$1"

                                                                                                                                                          

« PREV : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : ··· : 28 : NEXT »