Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# find in files
if [[ $# -eq 0 ]]; then
echo "usage: $0 \"<dir(s)>\" \"<include filename pattern (*test*/*.java)>\" \"<searchstring(s)>\" \"<exclude filename pattern (target|.svn|.git)>\" [\"-mindepth 3 -maxdepth 4\"] [-quiet]"; echo "";
echo "example: $0 . \"*test*/feature.*\" \"label|featureName\" target \"-mindepth 2 -maxdepth 4\" -q"; echo "";
exit 1;
fi
if [[ $1 ]]; then dirs=$1; else dirs="."; fi