[ale] Problems w/ mv and sed

Stephen Touset stephen at touset.dyndns.org
Mon Dec 23 19:21:37 EST 2002


I've been busy getting some music on gtk-gnutella, and it evidently
renamed files to $(FILENAME).OK if it's good after completion, or
$(FILENAME).BAD if it's corrupted. This is all fine and dandy, except
XMMS uses the filename to determine whether or not it can play the file.
Not to mention, I'd rather not have an .mp3 collection entirely named
.mp3.OK. So this is a job for sed, right? Well, here's the command I
wrote up, and here's the output:

for FILE in ./*\.OK; do mv \"$FILE\" \"`echo $FILE | sed -e
's/\.OK//'`\"; done;

mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

etc.

However, when I use an echo command within the statement:

for FILE in ./*\.OK; do echo mv \"$FILE\" \"`echo $FILE | sed -e
's/\.OK//'`\"; done;

I get:

mv "./Boston Pops - Final Fantasy 7 Theme.mp3.OK" "./Boston Pops - Final
Fantasy 7 Theme.mp3"
mv "./Boston Pops - Gone With The WInd - Tara's Theme.mp3.OK" "./Boston
Pops - Gone With The WInd - Tara's Theme.mp3"

etc.

Which seems to be as it should. Anyone know what might be causing this?

Stephen Touset

 This is a digitally signed message part




More information about the Ale mailing list