global_find.sh 235 B

123456789101112
  1. #!/bin/sh
  2. # $1: text to find
  3. # $2: file extension
  4. do_find()
  5. {
  6. for ext in $2; do
  7. find src include -name "*.$ext" -exec grep -n --color=always -H -i "$1" {} \; -exec echo "" \;
  8. done
  9. }
  10. do_find "$1" "c h cpp hpp s cc rs"