I am trying to make a simple bash script which prints out the path of current song in MPD.
while [ 1 ]
do
mpc idle
track=$(mpc current | awk -F " - " '{print $2}')
echo $track
path_to_track=$(mpc search title "$track")
echo $path_to_track
"$path_to_track" >> /home/noob/MPDPlaylist/testplaylist.m3u
done
Now, the problem is as soon as my script tries to appenf the value of path_to_track to the file it generates the below error
player
Skin To Bone
Linkin Park/Living Things(2012)/09 - Linkin Park - Skin To Bone.mp3
test.sh: line 8: Linkin Park/Living Things(2012)/09 - Linkin Park - Skin To Bone.mp3: No such file or directory
Now, what am I doing wrong here. As you can see in the above code I already tried adding double quotes .