簡體   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