GNU screen : Running commands in various window when screen is begun

The.screenrc documents permits the customer to define that they desire numerous home windows open when screen is first run. Eg.

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

What I would certainly such as is for each and every window to run some commands first, like :

screen -t myWindowA 0 "<go to directory a, source a.sh" 
screen -t myWindowB 1 "-${SHELL} <go to directory b, source b.sh>" 
screen -t myWindowC 2 "-${SHELL} <go to directoy c; start a watch on `ls -l`>"

Is there any kind of means to do that?

Note this resembles, yet various from this issue.

0
2019-12-02 03:09:23
Source Share
Answers: 1

Sure you can. On my web servers i have a / etc/screenrc with :

screen -t TOP 0 top
screen -t ETC 1 cd /etc
screen -t Console 2
0
2019-12-03 05:00:30
Source