Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!ubc-cs!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.unix.wizards Subject: Re: HELP converting filenames! Message-ID: <332@oha.UUCP> Date: 13 Oct 89 21:23:00 GMT References: <9234@pyr.gatech.EDU> <5003@omepd.UUCP> <9754@cadnetix.COM> Reply-To: tony@oha.UUCP Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada. Lines: 21 In-Reply-To: Message <9754@cadnetix.COM> dated 6 Oct 89 15:18:14 GMT Return-Path: In message <9754@cadnetix.COM>, rusty@cadnetix.COM (Rusty Carruth) writes: | | [A supposed solution that works better with emacs than vi] | | First, go to the directory of interest and do 'ls -1 > doit'. Chmod 777 | doit. Now, go edit 'doit' and make a macro which adds a space to the end | of the current line and then copies that line to its end (making a line | like 'file' end up as 'file file '), and then changes the added information | to all lower case, then goes to the next line. Now, execute that macro 200 | times. Now go back and add the 'mv' command to the front of each line | (another macro). Don't forget your #!/bin/csh (or sh), close and save, | execute it, and you are done. Oh blecch... vi # Edit *no* file. !!ls -1 # Get list of files to move. :%s/.*/mv & \L&/ # Build mv to lower-case. 1G!Gsh -x # Run mv commands. :q! # Don't save *no* file. -- Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).