From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 03:34:50 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B03C16A4CE for ; Mon, 26 Jan 2004 03:34:50 -0800 (PST) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 651F243D4C for ; Mon, 26 Jan 2004 03:34:42 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i0QBYbjc020854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Jan 2004 11:34:37 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i0QBYb4t020853; Mon, 26 Jan 2004 11:34:37 GMT (envelope-from matthew) Date: Mon, 26 Jan 2004 11:34:37 +0000 From: Matthew Seaman To: Andrew Kotsopoulos Message-ID: <20040126113437.GA19625@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Andrew Kotsopoulos , freebsd-questions@freebsd.org References: <4014F3FB.1030204@tue.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <4014F3FB.1030204@tue.nl> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: "rename" shell command X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 11:34:50 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 26, 2004 at 12:03:23PM +0100, Andrew Kotsopoulos wrote: > I'm looking for the "rename" shell command for the macosx version of=20 > bsd. In redhat and possibly other linux distributions the command=20 > renames files and supports wildcards and multiple file conversions, as=20 > you most likely know. To be more precise here is the man page: Interesting. Sounds like it would make a good port. However, check out the misc/mmv port -- it sounds like it has very similar functionality to the rename command you've been using. Anyhow, it's a pretty trivial script to write. Here's a perl verion I cooked up in a few minutes -- use with care as it has only had minimal testing. Note too that the 'from' expression is actually a perl regular expression, rather than a literal match. #!/usr/bin/perl -w $0 =3D~ s@.*/@@; if (@ARGV < 3) { die <