从Linux Makefile打开终端 [英] Opening a terminal from Linux Makefile

查看:182
本文介绍了从Linux Makefile打开终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以使用makefile或某些c文件从现有终端打开新的终端选项卡或窗口.

如果是,怎么办?预先感谢您的答复.

P.S.我想这样做是因为首先要在终端中运行服务器文件,然后要打开新的终端并在其中为客户端运行文件.

我要从第二个终端继续运行脚本.

解决方案

您可以尝试将xterm(最可用的终端窗口程序)与作为shell参数运行的程序一起运行.

xterm ./my_client &

要使此方法起作用,必须将DISPLAY环境变量设置为可用的值(如果您在本地运行X窗口,则可能会用到-如果您是远程连接,则更为复杂).

如果您想了解一下,可以尝试确定还有哪些其他的终端窗口程序以及用户想要使用的程序,但是我知道其中一些具有指定运行哪个外壳"的不同方法. /p>

Can we open a new terminal tab or window from the existing terminal using a makefile or some c file.

If yes how? Thanks in advance for replying.

P.S. I want to do this because first in the terminal I want to run the server file then I want to open the new terminal and there run the file for the client.

From the second terminal I want to continue running the script.

解决方案

You could try running xterm (the most available terminal window program) with the program to run as the shell argument.

xterm ./my_client &

For this to work the DISPLAY environmental variable would have to be set to something usable (which it probably will be if you are running X windows locally -- if you are connecting remotely then it's more complicated).

If you want to get fancy you can try to determine what other terminal window programs are available and what the user would want to use, but I know some of them have a different way of specifying which "shell" to run.

这篇关于从Linux Makefile打开终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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