Path: utzoo!attcan!uunet!samsung!usc!apple!oliveb!mipos3!omepd!merlyn From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: Changing upper-case filenames to lower-case Message-ID: <5249@omepd.UUCP> Date: 22 Nov 89 00:14:00 GMT References: <3116@jarthur.Claremont.EDU> Sender: news@omepd.UUCP Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Distribution: na Organization: Stonehenge; netaccess via Intel, Hillsboro, Oregon, USA Lines: 28 In-reply-to: kfink@jarthur.Claremont.EDU (Kevin Fink) In article <3116@jarthur.Claremont.EDU>, kfink@jarthur (Kevin Fink) writes: | Is there an easy way to change all the upper-case characters in a filename | (or set of filenames) to lower-case? | | Whenever I transfer files from my PC to the mainframe the filenames get | changed to all caps. This is really annoying. Deja vu. Didn't we just answer this one? The solution in Perl: perl -e 'for$f(<*>){($_=$f)=~y/A-Z/a-z/;rename($f,$_)unless$f eq$_;}' The solution in sh, tr, echo: for i in * do mv $i `echo $i | tr A-Z a-z` done There. Isn't this in the FAQ list? Just another Perl hacker, -- /== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\ | on contract to Intel's iWarp project, Hillsboro, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn | \== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/