From c922fb9f715279abf2e19bb733af2ac9690e3f49 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Mon, 24 Aug 2020 14:54:54 +0000 Subject: [PATCH] add port_grep and update doc --- extensions/openbsd.ksh | 7 +++++++ extensions/openbsd.org | 1 + 2 files changed, 8 insertions(+) diff --git a/extensions/openbsd.ksh b/extensions/openbsd.ksh index c8ff649..f38e559 100755 --- a/extensions/openbsd.ksh +++ b/extensions/openbsd.ksh @@ -8,6 +8,13 @@ port() { return } +port_grep() { + local _usage + _usage="port_grep [file] [pattern]" + [ -z $1 ] || [ -z $2 ] && echo $_usage + [ ! -z $1 ] && [ ! -z $2 ] && find /usr/ports -iname "${1}" -exec grep -iH ${2} {} \; +} + pclean() { find . -name \*.orig -exec rm {} \; find . -size 0 -exec rm {} \; diff --git a/extensions/openbsd.org b/extensions/openbsd.org index cfc9f27..e73a89d 100644 --- a/extensions/openbsd.org +++ b/extensions/openbsd.org @@ -10,6 +10,7 @@ The following functions are added: | maintains() | Similar to ~port()~, this will display the ~$MAINTAINER~ of a port passed in as the first argument. | | pclean() | Remove ~.orig~ and empty files from ~$CWD~. | | port() | Like ~src()~, but for ~/usr/ports~. | +| port_grep() | Recursively search ports tree for [file]'s that contain [pattern]. | | seq() | A shell implementation of Linux's [[https://linux.die.net/man/1/seq][seq(1)]] command. It supports alpha and numeric ranges. | | src() | Similar to plan9's [[http://man.9front.org/1/src][src(1)]] command. It drops you to ~/usr/src/*/~. |