Update 2024-12-31 10:47 OpenBSD/amd64-t14
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh -x
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "usage: port-search <file pattern> <search term>"
|
||||
echo "usage: port-search [file pattern] <search term>"
|
||||
exit 2
|
||||
fi
|
||||
type="$1"
|
||||
shift
|
||||
if [ -n "$2" ]
|
||||
then
|
||||
_filter="-iname *$1*" \
|
||||
_term="$2"
|
||||
else
|
||||
_term="$1"
|
||||
fi
|
||||
|
||||
find /usr/ports/ \
|
||||
-not \( -path "/usr/ports/pobj" -prune \
|
||||
@@ -16,5 +21,5 @@ find /usr/ports/ \
|
||||
-o -path "*/CVS" -prune \
|
||||
\) \
|
||||
-type f \
|
||||
-iname "$type" \
|
||||
-exec ugrep -F -- "$@" {} +
|
||||
$_filter \
|
||||
-exec ugrep -i -F -- "$_term" {} +
|
||||
|
||||
Reference in New Issue
Block a user