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.)
开发者_StackOverflowNOTE: 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.)
精彩评论