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.