Search code examples
linuxbashparent-childchild-process

"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?


Solution

  • 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.