简体   繁体   English

“无法执行子进程(没有此类文件或目录)”

[英]“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: 我试图绑定一个命令来运行脚本到openbox WM中的某个键,我使用以下xml行来做到这一点:

.
.
<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: 这是~/test.sh样子:

#!/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. 通过在绑定openbox中的密钥时删除bash可以解决此问题。 The openbox process runs the script and the shebang provided in the script invokes the corresponding interpreter itself. openbox进程运行脚本,脚本中提供的shebang调用相应的解释器本身。

First make sure that both bash and your script have the correct path. 首先,请确保bash和脚本均具有正确的路径。

$ 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. which bash返回的路径应在您的shebang和/或openbox wm中的脚本中。 If you get 'command not found', then you need fix your $PATH variable. 如果收到“找不到命令”,则需要修复$ PATH变量。

First line should be #!/usr/bin, not #!/usr/bin/. 第一行应该是#!/ usr / bin,而不是#!/ usr / bin /。 That "/" is a problem. 那“ /”是个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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