linux - How to create a script that opens multiple terminals and runs different programs on them?
问题描述
Good day everyone,
I am working on a project that requires me to have 7+ programs (no GUI, runs on shell) open, all interacting with each other. For example, Program 1 asks a question to Program 2, and it uses Program 3 and 4 to solve that etc.
所以我要做的是,我打开许多终端并在不同的终端上运行每个终端,然后将它们放在我的屏幕上并继续。但这是一个麻烦的过程,因为每次我需要重新编译时,我都需要一个一个地运行它们,更糟糕的是,如果我关闭计算机,我需要打开许多 shell,进入目录,运行它们都是某某。
我想要的是一个文件,它可以为我打开必要的终端窗口并转到每个窗口的正确目录,然后运行程序。我对 shell 脚本了解不多,但我认为这一定是可能的。你能给我任何指示吗?请注意,程序不应在后台或不同选项卡中运行。我需要经常观察显示器。
我读过这篇关于类似问题的帖子,但这对我不起作用,因为我需要在不同的终端上使用它们。
谢谢你。
解决方案
我们假设您正在使用gnome terminale,因此命令将是:
gnome-terminal --working-directory "{{APP_FOLDER}}" --command "{{APP_EXCUTABLE}}"
这种方法可以应用于任何其他终端仿真器。
推荐阅读
- php - 主键错误(自动增量 int)在 php 中调用存储过程
- playframework - 无法创建 PlayFramework@2.7.x 应用程序
- kubernetes - 安装prometheus监控Kubernetes集群报错
- typescript - 如何将数组方法与联合类型元素一起使用?
- python - 如何使用 Youtube Data APIv3 获取多个视频的统计信息?
- ios - AR Kit 2.0 跟踪来自服务器的图像
- php - FFMPEG 没有“解码”正确的 url 输入
- python - Keras 时间序列输入形状
- c++ - 调用默认构造函数时模板可变参数编译错误
- html - Bootstrap 4.1.3,下拉菜单不起作用