UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 24th, 2011, 04:11 PM
bluecrab22 bluecrab22 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 2 bluecrab22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 41 sec
Reputation Power: 0
Capture all screen i/o and error to a file

This isn't a simple redirect problem. I need to capture everything that appears on the terminal when a script runs and send it all to a file. This includes output, error, and user input.

The 'script' command is unsuitable because it forks a shell and when 'script' ends, so do any processes associated with that shell. Sometimes these processes have to continue after 'script' ends and 'script' doesn't allow that.

The reasons the usual I/O redirects (including tee) won't work are that user input isn't captured and also user prompts that request input never appear. Most of the time (but not always) I am calling a perl script, but it could be a shell script or simply a series of commands.

I have to remain in whatever shell I'm in when I log in to a system, so a shell-specific script is out - has to be straight Linux commands. I am starting to think that what I need may not be possible to do in the context of the shell, but I thought I'd ask anyway - you never know.

Thanks for reading all this!

Last edited by bluecrab22 : February 24th, 2011 at 04:12 PM. Reason: Clarification

Reply With Quote
  #2  
Old February 24th, 2011, 04:54 PM
L7Sqr L7Sqr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Constant Limbo
Posts: 989 L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 22 h 45 m 6 sec
Reputation Power: 362
Send a message via AIM to L7Sqr
Using screen you can log everything that happens using "Ctrl-A" "H".
The nice thing about screen is that you can detach from a running screen session and all processes will remain executing. I'm not sure how that interacts with what is being logged, but with some experimentation you can probably get what you are after.
__________________
True happiness is not getting what you want, it's wanting what you've already got.

My Blog

Reply With Quote
  #3  
Old February 25th, 2011, 09:40 AM
bluecrab22 bluecrab22 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 2 bluecrab22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 41 sec
Reputation Power: 0
Quote:
Originally Posted by L7Sqr
Using screen you can log everything that happens using "Ctrl-A" "H".
The nice thing about screen is that you can detach from a running screen session and all processes will remain executing. I'm not sure how that interacts with what is being logged, but with some experimentation you can probably get what you are after.


Thanks. I'm going to work with 'screen' for a while and see if it is appropriate for what I need.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Capture all screen i/o and error to a file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap