I'm writing a script to organize all my music files into folders according to their artist and album. I'm using id3tool to get the id3 information from the mp3s. When id3tool sends its output, there are two tabs before the artist/album. I'm using tr to get rid of the tabs.
So far, my code looks like this:
Code:
ARTIST=`id3tool "$CURRENT_FILE" | grep "Artist" | awk -F ":" '{print $2}' | tr -d '\011'`
if [ ! -d "$ARTIST" ]
then
mkdir "$ARTIST" #> /dev/null 2>&1
fi
The directory will be created, however the name will be something random like SCZZ9H~R. However, when I echo $ARTIST, the name is as it's expected to be.
I am at a loss as to why this is happening.