How do you start Unix screen command with a command?

后端 未结 6 1263
情歌与酒
情歌与酒 2020-12-13 03:20

According to the docs for the Unix \"screen\" command, you can configure it in .screenrc to start with a bunch of default screens, each running a command that you specify.

6条回答
  •  无人及你
    2020-12-13 03:51

    Here's how I'd do it.

    screen -t shell_0
    chdir ~/project/contactdb
    screen -t autotest autotest
    

    The above appears to be evaluated procedurally by screen. First we establish a new screen with the title shell_0. Since we gave no other options, current working directory will be that of the parent shell or the user's home directory. We then set the default directory for new screens to ~/project/contactdb. Next, we establish a new screen running the autotest command.

    Window number (n) is optional, I generally omit it.

提交回复
热议问题