Searching a folder with spaces via bash script #1496
Unanswered
nehasjains
asked this question in
Q&A
Replies: 2 comments 7 replies
-
|
The argument in your script should be quoted: |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Possible you should also redirect STDERR. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Installed mpd and mpc on my raspberry pi.
I want to search a folder(with spaces) in my library via mpc using bash script
#!/bin/sh
mpc --host=mypwd@127.0.0.1 --port=9999 ls $1
I am launching the script from terminal as follows
$ ./play.sh Bryan\ Adams
I am getting an error mpd error : No such directory.
Whereas if I run the mpc command directly from terminal as below mpc return the folder contents.
$ mpc --host=mypwd@127.0.0.1 --port=999 ls Bryan\ Adams
The command run from terminal fetches the result but if I run a bash script it gives error.
Kindly guide me how to fix this.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions