Article 4WQD6 id3v2 script problem

id3v2 script problem

by
Stanton02
from LinuxQuestions.org on (#4WQD6)
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
donei 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!latest?d=yIl2AUoC8zA latest?i=LKwL4uMDrPI:iVQpntXquTM:F7zBnMy latest?i=LKwL4uMDrPI:iVQpntXquTM:V_sGLiP latest?d=qj6IDK7rITs latest?i=LKwL4uMDrPI:iVQpntXquTM:gIN9vFwLKwL4uMDrPI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments