[英]How to run multiple screens each with a command programmatically?
我是linux屏幕工具的新手,现在我必须创建许多屏幕,并传递每个命令。 如何以编程方式实现该功能,而不是使用(Ctrl + ac)创建每个屏幕并在其中键入命令?
改用tmux
, tmux
具有更现代的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.