bash 命令在新的命令行窗口中运行程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4272984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
bash command to run a program in a new command line window
提问by SkypeMeSM
I want to run a program from inside a bash script, such that it opens in a new command line window. How can I do this?
我想从 bash 脚本内部运行一个程序,以便它在新的命令行窗口中打开。我怎样才能做到这一点?
回答by icyrock.com
That really depends on the GUI you are using. Try some of the below for executing an lscommand.
这实际上取决于您使用的 GUI。尝试以下一些方法来执行ls命令。
With gnome-terminal:
与gnome-terminal:
gnome-terminal -x bash -c "ls; bash"
With xterm:
与xterm:
xterm -e "ls; bash"
(taken from http://ubuntuforums.org/showthread.php?t=760006).
(取自http://ubuntuforums.org/showthread.php?t=760006)。
For konsole, take a look here:
对于konsole,请看这里:
or here:
或在这里:
回答by robert
xterm -e 'program to be run'
xterm -e 'program to be run'
Your terminal may have a different switch than -e, but I don't know what your terminal is.
您的终端可能具有与 不同的开关-e,但我不知道您的终端是什么。

