Suppose I opened up a screen to run some program that outouts some result.
Once the program finishes, is there a way to get the result in the screen from outside.
For example:
- I opened up a screen using "screen -S myscreen"
- I detached from the screen
- The program in screen finishes
- I want the result in the screen by command like
screen --get-result-from myscreen
PS:
I am currently deploying a distributed task over several machines. I need someway to get the result without visiting each screen individually.
UPDATE:
Any way to copy part of the content in screen? As there might be other irrelevant information.
screen -S myscreen -X hardcopy some-file
would save the content of the screen to a file. You could also use logging./path/to/myscript.sh arg arg arg | tail -n20 > /path/to/process_log.txt