Hi guys! i'm here with this simple script:
Code:
#!/bin/bash
for i in {1..9}
do
title_mp3=$( ls *0$i* )
echo "$title_mp3"
title_mp3=$(ls 0$i* |sed 's/ /\\ /g'|sed "s/'/\\\'/g")
id3v2 -t 0"$i".mp3 "$title_mp3"
done
for i in {10..39}
do
title_mp3=$( ls *$i* )
echo $title_mp3
done
i wrote this script in order to rename the title tag of mp3 chapter files of an audiobook.
These files have names like:
01 La regola dell'equilibrio_Uno.mp3
...
39 La regola dell'equilibrio_Trentuno.mp3
With the above script i want to assign the title
0$i_$title_mp3.mp3 to alle files up to the 9th and the title
$i_$title_mp3.mp3 to all the other files which start with 2 numbers (like 10, 11, 12 and so on).
So the question that i want to present are exentially two:
1 - I have a problem with the id3v2 command that regardless the "$title_mp3" variable is correct, during execution of the script i obtain the following result:
Couldn't stat file '01\ La\ regola\ dell\'equilibrio_Uno.mp3'
2 - you maybe think that this script is improvable? if yes how?
thank you so much for your TIME!