HELP converting filenames!
Tony Olekshy
tony at oha.UUCP
Sat Oct 14 07:23:00 AEST 1989
In message <9754 at cadnetix.COM>, rusty at 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 at oha.UUCP).
More information about the Comp.unix.wizards
mailing list