LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-02-2012, 01:26 PM   #1
savanna3000
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Smile 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
 
Old 01-02-2012, 01:35 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ 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
 
Old 01-03-2012, 12:31 AM   #3
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Quote:
Originally Posted by savanna3000 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 07:54 AM
Command "mail" returns "panic: temporary file seek" kenneho Linux - Software 5 12-23-2008 03:27 AM
i use the command "passwd" ,how to redirect input to a file? hillpigLQ Linux - Newbie 1 09-19-2008 12:31 PM
i use the command "passwd" ,how to redirect input to a file? hillpigLQ Linux From Scratch 1 09-19-2008 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration