From owner-freebsd-questions Sun Apr 18 20: 0:13 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 13B1B14D4C for ; Sun, 18 Apr 1999 20:00:09 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id VAA21726; Sun, 18 Apr 1999 21:57:32 -0500 (CDT) (envelope-from dan) Date: Sun, 18 Apr 1999 21:57:32 -0500 From: Dan Nelson To: Randall Hopper Cc: Mark Ovens , "Michael G." , David Kelly , questions@FreeBSD.ORG Subject: Re: Deleting packages - a newbie question Message-ID: <19990418215732.A21582@dan.emsphone.com> References: <199904190005.TAA41276@nospam.hiwaay.net> <19990418134728.A11854@ipass.net> <99041817400401.00341@Nikki.ibm.net> <19990418134728.A11854@ipass.net> <19990418192714.B252@marder-1> <19990418212520.A24218@ipass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <19990418212520.A24218@ipass.net>; from "Randall Hopper" on Sun Apr 18 21:25:20 GMT 1999 X-OS: FreeBSD 4.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Apr 18), Randall Hopper said: > Thanks for the suggestions. I realize I could write my own > custom wrapper script or alias to do this, as I mentioned, or do it > by hand each time. But I thought I'd troll the waters and see if > there was interest in this being the default behavior. It would make > the package commands just a little more accessible to new users. New users don't even know about pkg_delete; they simply run sysinstall and uncheck the little box in the "packages" section when they want to uninstall something. > Here's a shell snippet that does what I want: > > ( cd /var/db/pkg ; /bin/ls -1d mpeg_encode* ) | tr '\012' ' ' | > /bin/sh -c 'read pkg1 junk ; if [ -z "junk"]; then echo ERROR: > Multiple Matches ; echo $pkg1 $junk; else pkg_delete $pkg1; fi' How about using zsh and adding this to your /etc/zcomplete: compctl -g '/var/db/pkg/*(/:t)' pkg_delete pkg_info This will let you type "pkg_delete mpeg"; if there is only one match, it'll tab-complete it. If there are more, it'll beep and list your options (if you have menucomplete turned on) -Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message