使用 bash 打开新的控制台/lxterminal 窗口 - Raspbian Jessie Lite
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38320361/
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
open new console/lxterminal window using bash - Raspbian Jessie Lite
提问by dbmitch
EDIT
编辑
Raspbian Jessie Lite does not open to LXTerminal gui - it's just a console window - so unless there's a way to open a new "console" window it looks like I need to install lxterminal
Raspbian Jessie Lite 不会打开 LXTerminal gui - 它只是一个控制台窗口 - 所以除非有办法打开一个新的“控制台”窗口,否则我需要安装 lxterminal
I want to run a bash script and at the end just open a new command in another LXTerminal window
and let it run while I still have command line in my login window, when the bash script ends.
我想运行一个 bash 脚本,最后open a new command in another LXTerminal window
让它运行,而我的登录窗口中还有命令行,当 bash 脚本结束时。
I'm running Raspbian Jessie Lite on a Pi 3
我在 Pi 3 上运行 Raspbian Jessie Lite
I'm new in the Linux world - so I've tried typing in lxterm, lxterminal, LXTerminal from command line, obviously misunderstanding what is required.
我是 Linux 世界的新手 - 所以我尝试从命令行输入 lxterm、lxterminal、LXTerminal,显然误解了需要什么。
I've also tried running the command in the background using "&" but it seems to need terminal for output, as it fails and I can't see why. It runs fine by itself, but dumps a lot of continuous text to the terminal.
我也试过使用“&”在后台运行命令,但它似乎需要终端输出,因为它失败了,我不明白为什么。它本身运行良好,但将大量连续文本转储到终端。
Is it possible to open a new terminal window in Jessie Lite - if I can do that I can figure out how to pass the command to it when I start it up
是否可以在 Jessie Lite 中打开一个新的终端窗口 - 如果可以的话,我可以弄清楚如何在启动时将命令传递给它
Hoping it's an easy solution that I'm missing because of my newness to the Linux world
希望这是一个简单的解决方案,因为我对 Linux 世界不熟悉
EDIT
编辑
Note that I'm willing to download any utilities or other terminals if that makes it possible
请注意,如果可能的话,我愿意下载任何实用程序或其他终端
Thanks
谢谢
回答by Inian
You can use the bash
built-in lxterminal
programatically for this.
您可以为此bash
以lxterminal
编程方式使用内置。
lxterminal\
--title="MyScriptWindow" \
-e "bash -c ./somescript.sh;bash"\
bash
is triggered manually at the end to prevent the terminal from closing, after the command or the script completes.
bash
在命令或脚本完成后,在最后手动触发以防止终端关闭。