Open a terminal via gnome-terminal then execute command, error : “failed to execute child process”" [closed]

余生颓废 提交于 2019-11-27 03:36:00

问题


Via a bash command, I want open a terminal and, from the new terminal, execute a simple bash command.

I tried:

gnome-terminal -- "/bin/bash -c ls"

But I got this error:

I don't understand the error and I cannot find an example anywhere for help.


回答1:


The quotes are telling the terminal to run an executable in /bin called bash -c ls (with the spaces as part of its name!). There exists no such executable.

Take them out:

gnome-terminal -- /bin/bash -c ls

...or, to actually make something stay open until the user provides input...

gnome-terminal -- /bin/bash -c 'ls; read'


来源:https://stackoverflow.com/questions/48627989/open-a-terminal-via-gnome-terminal-then-execute-command-error-failed-to-exec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!