0

I am working on a production environment which uses linux screen to manage output. It has 8 instances names as 1$ bash, 2$ bash and so on. I want to store output of one instance to a file and was referring to this stackoverflow discussion (Edit section of question provides the solution). Till now, in order to reconnect my screen I do following:

screen -r 24813

where 24813 is session id.

And the screen instance I want to connect to is at pts/2 (I get this using who -aH).

In order to record only single instance(pts/2) I think I need to run:

script output.txt

and then some command to connect to only one instance(pts/2) of screen like:

screen -r 24813/dev/pts/2

or

screen /dev/pts/2 24813

Though I am not able to figure out how to record output of pts/2 only. Any help would be really appreciated.

Community
  • 1
  • 1
Sid
  • 589
  • 6
  • 20
  • 1
    Can't you run `script` inside the screen session? – choroba Sep 08 '16 at 12:22
  • Thanks. I had tried tee from inside screen but didn't tried script. For the record one has to use flush option (-f) along with script otherwise output won't be written to file promptly – Sid Sep 08 '16 at 12:52

0 Answers0