dotfiles/.bin/port-search

21 lines
429 B
Plaintext
Raw Normal View History

#!/bin/sh
if [ -z "$1" ]
then
echo "usage: port-search <file pattern> <search term>"
exit 2
fi
type="$1"
shift
find /usr/ports/ \
-not \( -path "/usr/ports/pobj" -prune \
-o -path "*/distfiles" -prune \
-o -path "*/packages" -prune \
-o -path "*/logs" -prune \
-o -path "*/CVS" -prune \
\) \
-type f \
-iname "$type" \
-exec ugrep -F -- "$@" {} +