Bash script generating error while trying to append text to a file -


i trying make simple bash script prints out path of current song in mpd.

while [ 1 ] 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, problem script tries appenf value of path_to_track file generates below error

player skin bone linkin park/living things(2012)/09 - linkin park - skin bone.mp3 test.sh: line 8: linkin park/living things(2012)/09 - linkin park - skin bone.mp3: no such file or directory 

now, doing wrong here. can see in above code tried adding double quotes .

right you're trying execute mp3 files. wanted echo that:

echo "$path_to_track" >> /home/noob/mpdplaylist/testplaylist.m3u 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -