GNU屏幕:启动屏幕时在不同窗口中运行命令

.screenrc文件允许用户指定在首次运行屏幕时打开多个窗口。 例如。

screen -t myWindowA 0 "" screen -t myWindowB 1 "-${SHELL}" screen -t myWindowC 2 "-${SHELL}" 

我想要的是每个窗口首先运行一些命令,如:

 screen -t myWindowA 0 "<go to directory a, source a.sh" screen -t myWindowB 1 "-${SHELL} " screen -t myWindowC 2 "-${SHELL} " 

有没有办法做到这一点?

请注意,这与此问题类似,但不同。

你当然可以。 在我的服务器上,我有一个/ etc / screenrc

 screen -t TOP 0 top screen -t ETC 1 cd /etc screen -t Console 2