From owner-freebsd-questions Sun Jul 23 18:51:51 2000 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 11E7937B9A0 for ; Sun, 23 Jul 2000 18:51:47 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id UAA25468; Sun, 23 Jul 2000 20:51:45 -0500 (CDT) (envelope-from dan) Date: Sun, 23 Jul 2000 20:51:44 -0500 From: Dan Nelson To: Matt Pillsbury Cc: freebsd-questions@FreeBSD.ORG Subject: Re: There must be a better way.... Message-ID: <20000723205144.A25032@dan.emsphone.com> References: <20000723192635.A94476@straylight.NONE> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.3.5i In-Reply-To: <20000723192635.A94476@straylight.NONE>; from "Matt Pillsbury" on Sun Jul 23 19:26:35 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Jul 23), Matt Pillsbury said: > I'm running bash, and I recently wanted to change a bunch of filenames > in a directory based on a glob: changing *.JPG to *.jpg . I knew that > > mv *.JPG *.jpg > > wouldn't cut it, but the solution I ultimately used seems really > cumbersome: > > for NAME in *.JPG; do mv $NAME `echo $NAME | sed -e 's/JPG/jpg/'`; done I really like ports/misc/mmv for things like this. It'll even warn you about name conflicts with existing files. mmv "*.JPG" "=1.jpg" -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message