我是linux屏幕实用程序的新手,现在我必须创建许多屏幕,并向每个屏幕传递一些命令。如何以编程方式实现这一点,而不是使用(Ctrl+a c)创建每个屏幕并在其中键入命令?
发布于 2016-07-07 16:17:59
使用tmux代替,tmux有一个更现代的应用程序接口,并且在大多数情况下都很容易使用。要使用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 ^bhttps://stackoverflow.com/questions/31155792
复制相似问题