Path: utzoo!utgpu!cs.utexas.edu!sdd.hp.com!usc!apple!agate!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal L. Schwartz) Newsgroups: alt.sources.d Subject: Re: Neat utility to convert uppercase filenames Message-ID: <1990Dec11.042530.28650@iwarp.intel.com> Date: 11 Dec 90 04:25:30 GMT References: <76@gdx.UUCP> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal L. Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 25 In-Reply-To: pinard@IRO.UMontreal.CA (Francois Pinard) In article , pinard@IRO (Francois Pinard) writes: | I use this: | | #!/bin/sh | # Convert upper case in file names to lower case. | # Copyright (C) 1990 Free Software Foundation, Inc. | # Francois Pinard , October 1990. | | echo $* \ | | tr " " "\012" \ | | gawk '{ if ($1 != tolower($1)) { print "mv", $1, tolower($1) } }' \ | | sh | | I'm sure there is a one-liner in Perl to do the same :-). Like: perl 'for (@ARGV) {($n = $_) =~ y/A-Z/a-z/; rename($_,$n) unless -e $n;}' * Just another Perl hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/