Re: Relabeling all audio files on a server

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

 



Leonard Adjei wrote:
> I have a server which houses thousands of audio tracks and materials.
> Recently I started using a web application which seems to have a ew
> problems with the naming convention used by default.
> For example it has a problem with apostrophe signs ('), I want to be
> able to create a script which goes to through the folder and all
> files and folders under it and renames all the tracks by deleting
> every entry of the apostrophe where it encounters them.
> E.g. This ain't no game => This aint no game
>        Mr Brown's Last supper => Mr Browns Last supper
> and like that. I want the apostrophe sign to be deleted but everything
> else stays the same.
> Any suggestions on doing this would really be appreciated. Thanks.

Suggestions:
1 - any mass rename opens you to disaster
2 - may not handle blanks well either
3 - possible solution below

find . -name "*'*.wav" |
while read item; do
   dir=${item%/*}
   oldname=${item##*/}
   newname=${oldname//\'/}
   mv "$dir/$oldname" "$dir/$newname"
done

Beware typos, I just typed that in...

-- 
Bill Davidsen <davidsen@xxxxxxx>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux