0

I have processes that I background with screen. I'm trying to write a script that attaches to a terminal, executes a couple commands, then detaches. The problem is that when I attach to a terminal, screen directs control to the user. How do I work around this?

Drew Stephens
  • 17,207
  • 15
  • 66
  • 82
David Berger
  • 12,385
  • 6
  • 38
  • 51

1 Answers1

5

Screen has an option -X which you can use to remote-control a screen session from within a script. See, for example, here.

Mark Probst
  • 7,107
  • 7
  • 40
  • 42
  • That lets me send screen commands to screen. Is there any way to send arbitrary commands to the terminal running inside screen? – David Berger Mar 20 '09 at 17:46