scripts

My personal collection of scripts
git clone git://src.gearsix.net/scriptsscripts.zip
Log | Files | Refs | Atom | README | LICENSE

grepr.sh (raw) (352B)


   1 #!/usr/bin/env sh
   2 # grepr (grep recursively)
   3 # description: find files containing string $2 in directory/file $1
   4 # dependencies: grep
   5 # e.g.$ grepr dogs/ "shades"
   6 
   7 if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
   8 	echo "Usage: grepr DIRECTORY EXPRESSION"
   9 	echo ""
  10 	echo "call grep EXPRESSION on all files in DIRECTORY"
  11 	exit
  12 fi
  13 
  14 grep -rnw "$1" -e "$2"
  15