Tom writes:
> Wouldn't it be nice if I could tell the following to everyone to type
> "command keyword" or "command string", and a list of applications related
> to that keyword or string would be provided.
# ptxdeb public domain 12/14/98 by John Hasler
# ptxdeb uses the GNU permuted index program ptx to produce KWIC indexes of
# the Debian Packages file. Requires a fixed ptx. ptx_0.4-5 is broken.
CONFFILE="/etc/ptxdeb/ptxdeb.conf"
PACKAGES=`cat $CONFFILE`
usage () { echo "$VERSION usage: ptxdeb keyword
Edit /etc/ptxdeb/ptxdeb.conf to read a different Packages file."; }
case "$#"
in
0) cat $PACKAGES | awk '/Package:/ { printf "%s", $2 }; \
/Description:/ { $1 = ""; print}' | ptx -r ;;
1) case "$1"
in
--help) usage; exit 0;;
--version) echo "ptxdeb $VERSION"; exit 0 ;;
*) cat $PACKAGES | awk '/Package:/ { printf "%s", $2 };
/Description:/ \
{ $1 = ""; print}' | ptx -r | awk '/^[a-zA-Z0-9]+.* [a-zA-Z0-9]+.*
'$1'.*/' ;;
esac;;
*) usage ; exit 1;;
esac
exit 0
Hack it to operate on Available instead of Packages and add bells and
whistles to taste.
--
John Hasler
[EMAIL PROTECTED] (John Hasler)
Dancing Horse Hill
Elmwood, WI