1 2 3 4 5 6 7 8
#!/bin/sh type="$1" shift 1 grep -r '\(define\s\+\(__kernel_\)\?'"$type"'\s\|typedef\s.*\s\(__kernel_\)\?'"$type"'\b\)' "$@" \ | sed 's/^\([^:]*\):/\x1b[35m\1\x1b[m /' \ | sed 's/\(__kernel_\)\?'"$type"'/\x1b[1;31m&\x1b[m/g'