Re: Spaces in file names



The suggestion shown below won't work. As I said in theoriginal post, I
already thought of this. I'm not just adding an extension or something like
that. As an example of exactly what I need to do, I need to change the file
named "The Hunt for Red October (Recorded 10/10/2007 18:03).TiVo" to "Hunt
for Red October, The (Recorded 10/10/2007 18:03).TiVo".

"Paul Pluzhnikov" <ppluzhnikov-nsp@xxxxxxxxx> wrote in message
news:m3y7bbk4r9.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Leslie Rhorer" <lrhorer@xxxxxxxxxxx> writes:

OK, here's the problem. I need to automatically manipulate the file
names
of a number of files whose filenames have spaces in them.

Here is an example:

$ touch "a b" "c d" "e f g"
$ ls -1
a b
c d
e f g

$ find . -type f | while read line; do mv "$line" "$line.bak"; done
$ ls -1
a b.bak
c d.bak
e f g.bak

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


.



Relevant Pages

  • Re: newbie exploring better ways
    ... recursion entailed. ... Griff's suggestion is one of the cleanest solutions to this problem ... LOOP version (and if there's a clean LOOP solution I trust Ken to find ... plus a reverse, a DO with a REVERSE at the end has no side effects, ...
    (comp.lang.lisp)
  • Re: Problems with differences between system and exec functions
    ... Just to be sure I didn't overlook your suggestion given that I've tried ... If xulrunner-bin examines its argv, ... xulrunner-bin *starts* (and by that time execl has done its job ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.internals)
  • Re: malloc blocked on Linux
    ... "Shuqing Wu" writes: ... > Any suggestion? ... type 'thread apply all bt' at the gdb prompt and post the result! ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.questions)
  • Re: Recursive Call
    ... both direct and indirect recursion is prohibited. ... > implementor allows it (or provides additional syntax to support it), ... > an extension and it does whatever the implementor says it does. ...
    (comp.lang.cobol)