[SLUG] looking for a rename tool

From: Mike Manchester (mchester@pobox.com)
Date: Fri Feb 14 2003 - 04:39:05 EST


I'm looking for an easy way to rename or delete a bunch of files that
have windows type names. Names with ( ,' and spaces in them. I have a
little oneliner that will do this for files in the current dir.
# replace spaces with _ change ' ' to '(' to replace (
for i in *.*; do mv "$i" `echo $i | tr ' ' '_'`; done

I have a large number of mp3 files in a number of dirs. I found a
program on freshmeat.net that will find mp3dups. Appears I have a lot of
them. The output from mp3dup is in the format of
Match:Identical:/data/music/Rock/(MIKE_AND_THE_MECHANICS)-THE_LIVING_YEARS.mp3:/data/music/Rock/Mike_And_The_Mechanics_-_the_living_years.mp3
Because of the :'s this is easy to parse with awk and put " " around the
first entry.

head dups.txt | awk {'FS=":";print "\"" $3 "\" " $4'}

But this is where I'm getting stuck if I do the following
diff ` head dups.txt | awk {'FS=":";print "\"" $3 "\" " $4'}`

I get back this message.
diff: extra operand
`/data/music/Oldies/Herman's_Hermits_-_I'm_Into_Something_Good.mp3'
diff: Try `diff --help' for more information.

I'm not sure what I'm missing here. Is it the ( ) in the file name
causing this, even though the filename is quoted? The code between the `
should be returning "file(name)" "filename" to diff which should act on
them.

I also think I can use the output for mp3dup to also remove the files
that are different.

Any help or suggested are welcome.
Thanks
Mike M.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:21:11 EDT