From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 17:23:46 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 CB00C16A4CE for ; Mon, 26 Jan 2004 17:23:46 -0800 (PST) Received: from mta5.adelphia.net (mta5.adelphia.net [68.168.78.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E6AE43D6A for ; Mon, 26 Jan 2004 17:22:49 -0800 (PST) (envelope-from parv_fm@mailsent.net) Received: from moo.holy.cow ([69.160.71.102]) by mta13.adelphia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040127011532.PQHT8989.mta13.adelphia.net@moo.holy.cow>; Mon, 26 Jan 2004 20:15:32 -0500 Received: by moo.holy.cow (Postfix, from userid 1001) id 36C45A203; Mon, 26 Jan 2004 20:15:26 -0500 (EST) Date: Mon, 26 Jan 2004 20:15:26 -0500 From: parv To: Andrew Kotsopoulos Message-ID: <20040127011525.GA4809@moo.holy.cow> Mail-Followup-To: Andrew Kotsopoulos , f-questions References: <4014F3FB.1030204@tue.nl> <20040126133744.GA858@moo.holy.cow> <40152820.5080206@tue.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40152820.5080206@tue.nl> cc: f-questions Subject: History of Rename, as I Know It (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: Tue, 27 Jan 2004 01:23:46 -0000 in message <40152820.5080206@tue.nl>, wrote Andrew Kotsopoulos thusly... > > parv wrote: > > > http://groups.google.com/groups?th=b45310c8ba0519a > > Thanks for the tips to all that responded to me - I've seen quite > a few suggestions for scripts of various kinds. Did you send personalized email to everybody or you forgot to copy -questions? > what I really want to know is what's the offical story with > "rename"? On my redhat 8 dist. it's a binary and lives in > /usr/bin. I believe it was part of the fileutils or coreutils > package and they are supposed to be GNU packages (or not?) The original "rename" was, as i know it, from Larry wall, creator of Perl. From http://groups.google.com/groups?selm=33089%40adm.brl.mil ... If you have the "perl" language installed, you may find this rename script by Larry Wall very useful. It can be used to accomplish a wide variety of filename changes. #!/usr/bin/perl # # rename script examples from lwall: # rename 's/\.orig$//' *.orig # rename 'y/A-Z/a-z/ unless /^Make/' * # rename '$_ .= ".bad"' *.f # rename 'print "$_: "; s/foo/bar/ if =~ /^y/i' * $op = shift; for (@ARGV) { $was = $_; eval $op; die $@ if $@; rename($was,$_) unless $was eq $_; } ...I heard/read once about it when i was starting with Perl more than 5 years ago. The original "rename" was not part of the standard Perl distribution; it was included by distributor(s) of Linux... http://www.oclug.on.ca/pipermail/oclug/2002-March/018696.html ...which mentions your RedHat too, besides mentioning that rename appeared in "Programming Perl", first edition. It seems to appear & had appeared under similar name for the same purpose. Sometimes the program is wholly independent, else it is enhancement of the original. Mother necessity is of invention, or something like that. I also noticed some blurb in comp.* newsgroup that involved "C" and "rename". Oh wait ... # man -aw rename ...ok, there is also rename(2), a C library function, in libc, that "conform[s] to ISO/IEC 9945-1:1996 (``POSIX.1'')". - Parv --