How can I start new window in the same screen session automatically?

Posted by Mato on Super User See other posts from Super User or by Mato
Published on 2013-10-30T13:53:04Z Indexed on 2013/10/30 15:58 UTC
Read the original article Hit count: 166

Filed under:
|
|
|

I read How can I start multiple screen sessions automatically?, but I don't understand the first accepted reply:

screen -dmS "$SESSION_NAME" "$COMMAND" "$ARGUMENTS"

In my case I need to automatically create one screen session for one script, and afterwards I need to create a new window in the same session for another script. Manually, I would:

  1. run screen
  2. enter command
  3. CTRL+A
  4. CTRL+C
  5. enter command
  6. CTRL+A
  7. CTRL+D

How can I do this automatically in a script? A simple example would help me a lot.

Thank you for replies.

© Super User or respective owner

Related posts about bash

Related posts about display