@terdon's answer provides this script:find . -type f -name *mp3 | while read file; do     album=$(basename $(dirname $file));     filename=$(basename $file);     artist=${filename%%-*};     title=${filename##*-};     title=${title%%.mp3};     eyeD3 -A $album -t $title -a $artist $file; doneIt makes use of eyeD3 to update mp3 tags. It extracts Album, Artist and Title from file name, supposing that the file name is Album/Artist - Title.mp3. Well, after running it the Title field is starting with a blank space. See below:How to fix this if my mp3 files have the patternAlbum/<Artist with possible spaces> - <track number> - <Title with possible spaces>.mp3
Script to split string
bash;shell script;string
Since I assume that your names do not always have these spaces, the easiest thing to do would be to simply remove the space if present: find . -type f -name *mp3 |   while read file; do    album=$(basename $(dirname $file));    filename=$(basename $file);    artist=${filename%%-*}; artist=${artist%% }; artist=${artist## };   title=${filename##*-}; title=${title%% }; title=${title## };   title=${title%%.mp3};    eyeD3 -A $album -t $title -a $artist $file; done