这个问题在这里已经有了答案:
Open a terminal via gnome-terminal then execute command, error : "failed to execute child process"" [closed]
(1 个回答)
2年前关闭。
到目前为止,我有这个有效的命令
gnome-terminal --tab -e '/bin/bash -c "ls";bash'
但有一个警告
# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.
当我把它改成
gnome-terminal --tab -- '/bin/bash -c "ls";bash'
新标签失败
There was an error creating the child process for this terminal
Failed to execute child process “/bin/bash -c "ls";bash” (No such file or directory)
最佳答案
原因是:
gnome-terminal --tab -- '/bin/bash -c "ls";bash'
失败是它正在寻找一个以它为名称的程序。这是链加载的一个实例,其中其余参数按原样传递给 exec。第一个参数是程序的名称。通过此引用,它接收整个命令和选项作为单个程序名称。
将引用更改为:
gnome-terminal --tab -- /bin/bash -c "ls;bash"
关于bash - 在 gnome 终端的新选项卡中运行脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58143512/