[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rename files



On Tue, Mar 21, 2000 at 03:57:14PM +0100, Robert Kasunic wrote:
> Hi!
> 
> I'm trying to rename a lot of files. I just want to substitute underlines
> with whitespaces. How can I do that?

Given that spaces can interfere with shell parsing, particularly for
loops of the "for foo in $bar; do something; done" variety, one option I
often fall back on is to use vi-mode shell editing and invoke a vi
editing session:

    set -o vi
    <esc>k
    vi

...you're now in a full vi session.  Read in the list of files you want
to rename, and use substitute-and-replace editing commands to create the
set of commands you want.  Then exit the buffer.  The commands will be
executed.

If this is too close to the metal, you could write a short sell script,
test it, run it, and delete it.


-- 
Karsten M. Self (kmself@ix.netcom.com)
    What part of "Gestalt" don't you understand?

Scope out Scoop:  http://scoop.kuro5hin.org/
Nothin' rusty about Kuro5hin:  http://www.kuro5hin.org/


Reply to: