The following replaces "abcd_mixdown.mp3" to "abcd_vo.mp3" for every mp3 file of the current directory.
for mp3 in *.mp3; do renamedmp3=$(echo "$mp3" | sed 's/_mixdown.mp3$/.mp3/'); mv ./"$mp3" ./"$renamedmp3; done"
The next one goes even further, it does the same thing with all current and subdirectory:
#!/bin/bash
list=$(find -name '*.mp3' | grep '_mixdown\.mp3');
for mp3FilePath in $list
do
newMp3FilePath=$(echo "$mp3FilePath" | sed 's/_mixdown\.mp3/_vo\.mp3/')
mv $mp3FilePath $newMp3FilePath
done
No comments:
Post a Comment