Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!hal!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery) Newsgroups: comp.unix.wizards Subject: Re: HELP converting filenames! Message-ID: <1989Oct13.001034.16673@NCoast.ORG> Date: 13 Oct 89 00:10:34 GMT References: <9234@pyr.gatech.EDU> <5003@omepd.UUCP> <9754@cadnetix.COM> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery) Followup-To: comp.unix.wizards Organization: North Coast Public Access UN*X, Cleveland, OH Lines: 38 As quoted from <9754@cadnetix.COM> by rusty@cadnetix.COM (Rusty Carruth): +--------------- | In article <5003@omepd.UUCP> merlyn@iwarp.intel.com (Randal Schwartz) writes: | >In article <9234@pyr.gatech.EDU>, david@pyr (David Brown) writes: | >| Hiya. I have a friend who has about 200 files in a directory that are all | >| upper case. They are data files that need to be in lower case, because | >| his brain-dead program won't recognize upper case letters. | > | | | First, go to the directory of interest and do 'ls -1 > doit'. | Chmod 777 doit. Now, go edit 'doit' (for all you emacs haters | out there, sorry but emacs seems to work better for what I'm about | to suggest than does vi) and make a macro (sorry folks, this | trick will pretty much require emacs) which adds a space or two +--------------- Nonsense. vi: :1,$s/.*/mv & &/ emacs: M-X replace-regexp RET ^.*$ RET mv \& \& RET You did, however, forget to switch the case on the second copy. My usual way of doing it: ls | sed 'h;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;x;G;s/\n/ /;s/^/mv /' | sh (Usually, I do this twice, the first time with "echo" instead of "mv", so I can make sure I didn't blow it. I just tested this, BTW; it works fine under Xenix. Other OSes may vary, but it should work under standard System V's.) ++Brandon -- Brandon S. Allbery, moderator of comp.sources.misc allbery@NCoast.ORG uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu bsa@telotech.uucp, 161-7070 BALLBERY (MCI), ALLBERY (Delphi), B.ALLBERY (GEnie) Is that enough addresses for you? no? then: allbery@uunet.UU.NET (c.s.misc)