开发者

Script for opening GNU screen or similar with lots of the same process

I'd like to type (at bash)

./start_screen.sh 3 some_cmd with parameters

and have it start up GNU screen with three separate, independent copies of the running command some_cmd with parameters running in bash in three separate vertically-split windows. What's the best way to do this? Does someone know how to put the pieces together?

(This is so I can run three worker daemons in the background and monitor them in one window.)

开发者_StackOverflow

NOTE: alternatives to screen are just fine. In fact, at worst, it's ok if you can't interact with the windows apart from killing them all at once. (I mostly just want to see the outputs in parallel.)


screen executes commands from $HOME/.screenrc on startup by default.

You can override this with the -c option.

Create a temporary file with the commands you want, then run screen -c your-file.

This won't get the default settings you already have in $HOME/.screenrc unless you copy them to the temporary file.

(Disclaimer: I haven't tried this.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜