通过gnome-terminal打开终端,然后执行命令,错误:“无法执行子进程". [英] Open a terminal via gnome-terminal then execute command, error : "failed to execute child process""

查看:531
本文介绍了通过gnome-terminal打开终端,然后执行命令,错误:“无法执行子进程".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过bash命令,我想打开一个终端,然后从新终端执行一个简单的bash命令.

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

我尝试过:

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.

推荐答案

引号告诉终端在/bin中运行名为bash -c ls的可执行文件(空格是其名称的一部分!).没有这样的可执行文件.

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.

将它们取出:

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'

这篇关于通过gnome-terminal打开终端,然后执行命令,错误:“无法执行子进程".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆