繁体   English   中英

如何以编程方式运行每个命令的多个屏幕?

[英]How to run multiple screens each with a command programmatically?

我是linux屏幕工具的新手,现在我必须创建许多屏幕,并传递每个命令。 如何以编程方式实现该功能,而不是使用(Ctrl + ac)创建每个屏幕并在其中键入命令?

改用tmuxtmux具有更现代的API,并且在大多数情况下易于使用。 为了使用tmux实现您的目的,您需要:

$ 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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM