You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
491 B
32 lines
491 B
6 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
after=0
|
||
|
before=0
|
||
|
search=''
|
||
|
if [ $# == 0 ]; then
|
||
|
echo "Usage: $0 [-A <after>] [-B <before>] query"
|
||
|
exit 1
|
||
|
fi
|
||
|
while [ $# != 0 ]; do
|
||
|
case "$1" in
|
||
|
-A)
|
||
|
after="$2"
|
||
|
shift
|
||
|
shift
|
||
|
;;
|
||
|
-B)
|
||
|
before="$2"
|
||
|
shift
|
||
|
shift
|
||
|
;;
|
||
|
*)
|
||
|
search="$search $1"
|
||
|
shift
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
|
||
6 years ago
|
#echo grep -r -i -n --color="always" --include="*.{php,phtml}" -A "$after" -B "$before" "$search" .
|
||
|
grep -r -i -n --color="always" --include=\*.php -A $after -B $before $search .
|
||
|
|