How do you start Unix screen command with a command?

后端 未结 6 1247
情歌与酒
情歌与酒 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:46

    Your program is being run (well, except the cd), it's just that it's being run without a parent shell, so as soon as it completes, it exits and you're done.

    You could do:

    screen -t "autotest" 2 bash -c 'cd ~/project/contactdb ; autotest'
    

    Spawns two shells, but life will probably go on.

提交回复
热议问题