简体   繁体   中英

“Failed to execute child process (no such file or directory)”

I am trying to bind a command to run a script to some key in openbox WM.I did that with the following xml lines:

.
.
<keybind key="W-t">
  <action name="Execute">
    <command>"bash /home/bibek/test.sh"</command>
  </action>
</keybind>
.

When I try to invoke the command using the key combination I so assigned, I get a pop-up with the error message:

Failed to execute child process "bash /home/bibek/test.sh" (no such file or directory)

This is what ~/test.sh looks like:

#!/usr/bin/env bash
audacious & exit`  

I wish to be able to do more things obviously; it's a test script. The script runs as expected from terminal. What might be the problem here?

This gets resolved by removing the bash while binding the key in openbox. The openbox process runs the script and the shebang provided in the script invokes the corresponding interpreter itself.

First make sure that both bash and your script have the correct path.

$ which bash
$ ls /home/bibek/test.sh

The path returned from which bash should be in your shebang and/or in the script in openbox wm. If you get 'command not found', then you need fix your $PATH variable.

First line should be #!/usr/bin, not #!/usr/bin/. That "/" is a problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM