首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何以编程方式运行多个屏幕,每个屏幕使用一个命令?

问如何以编程方式运行多个屏幕,每个屏幕使用一个命令?
EN

Stack Overflow用户
提问于 2015-07-01 16:04:59
回答 1查看 135关注 0票数 0

我是linux屏幕实用程序的新手,现在我必须创建许多屏幕,并向每个屏幕传递一些命令。如何以编程方式实现这一点,而不是使用(Ctrl+a c)创建每个屏幕并在其中键入命令?

EN

回答 1

Stack Overflow用户

发布于 2016-07-07 16:17:59

使用tmux代替,tmux有一个更现代的应用程序接口,并且在大多数情况下都很容易使用。要使用tmux实现您的目标,您需要:

代码语言:javascript
复制
$ tmux new-session -s foo -d                # create a new session called foo
$ tmux new-window -t foo                    # create a new window
$ tmux send-keys -t foo.0 ./your_script.sh  # window number starts with 0
$ tmux new-window -t foo                    # another new window
$ tmux send-keys -t foo.1 ./another_command # another of your script
...
$ tmux attach -t foo                        # attach to your session, escape key is ^b
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31155792

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档