Gabriel L. Briones III wrote:

> I have lot's of mp3 files that has this format
> 
>      Mr.%20Big%20-%20Just%20Take%20My%20Heart.mp3
> 
> 
> what I did to rename this file in a more readable form is this
> 
>    $ mv  Mr.%20Big%20-%20Just%20Take%20My%20Heart.mp3 "Mr. Big - Just Take My 
> Heart.mp3"
> 
> But you dont want to do that if you have thousands of files.
> 
> I know that a script can do this but I don't know how to do it.
> Can somebody please enlighten me on this?

Try this too:


#!/bin/bash

for mp in *.mp3
do
    new=${mp//"\%20"/_}
    mv $mp $new
done

I use "_" as the replacement string not a whitespace since it's
simpler. Using a whitespace would give out error for the mv command.


--
Benj
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to