LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Redirect "screen" command window to file (https://www.linuxquestions.org/questions/linux-general-1/redirect-screen-command-window-to-file-921639/)

savanna3000 01-02-2012 01:26 PM

Redirect "screen" command window to file
 
Hi,
I'm running "screen ./script.sh" which has output messages that I can see only if the screen didn't terminate. Once it's terminated, all the output is gone somewhere (I guess). How can I redirect or copy/paste all the screen window to a file?

I've tried the regular redirection '>', no use. The only thing I found in screen command is the Ctrl+a [ which stops the window from scrolling and then I can copy the parts I want, but this is no use if I logged out of the window and missed the part I want. Any ideas?

Thank you
Savanna

T3RM1NVT0R 01-02-2012 01:35 PM

@ Reply
 
Hi savanna3000,

Could you please paste the contents of the script so that we can understand what exactly this script does. Please paste the output of the following command:

Code:

cat /script.sh

tommyttt 01-03-2012 12:31 AM

Quote:

Originally Posted by savanna3000 (Post 4563955)
Hi,
I'm running "screen ./script.sh" which has output messages that I can see only if the screen didn't terminate. Once it's terminated, all the output is gone somewhere (I guess). How can I redirect or copy/paste all the screen window to a file?

I've tried the regular redirection '>', no use. The only thing I found in screen command is the Ctrl+a [ which stops the window from scrolling and then I can copy the parts I want, but this is no use if I logged out of the window and missed the part I want. Any ideas?

Thank you
Savanna

Hi Savanna3000;
Have you tried using redirection in the bash shell? Example: "screen ./script.sh > filename 2>&1" would send both normal and error messages to 'filename'.

Tom


All times are GMT -5. The time now is 01:35 AM.