Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8190193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:32:28+00:00 2026-06-07T03:32:28+00:00

I am trying to make a simple bash script which prints out the path

  • 0

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 .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:32:31+00:00Added an answer on June 7, 2026 at 3:32 am

    Right now you’re trying to execute your mp3 files. You probably wanted to echo that:

    echo "$path_to_track" >> /home/noob/MPDPlaylist/testplaylist.m3u
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do a very simple bash script which emulates the behavior
i am trying to make a very simple bash script to find files matching
I'm trying to make simple script using jquery $post function to pass data to
I am fairly new to iOS development and trying make a simple app which
I am trying to make a a simple script of finding the largest word
I am trying to make a bash script that moves a file or directory
I'm trying make a simple control, with a some path in it. And binding
I'm trying to do a simple check in a bash build script to check
I'm trying to make a simple script to run different tasks one by one
Trying to make simple minesweeper game in python, but have one problem. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.