LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-30-2010, 06:40 AM   #1
ira
LQ Newbie
 
Registered: Sep 2010
Posts: 5

Rep: Reputation: 0
How to write a log file of a user interactive process using tee.


Hi,
I want to write the sequence of operation of a user interactive process (Question asked by the process and answers user entered) in to a log file.

I used tee command,
Precess1 | tee -a FileName

This write only the Question asked by the process. Does anybody know how to write the user inputs also to the same file, synchronized?

Thanks in advance.
 
Old 09-30-2010, 10:53 AM   #2
randolf_carter
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by ira View Post
Hi,
I want to write the sequence of operation of a user interactive process (Question asked by the process and answers user entered) in to a log file.

I used tee command,
Precess1 | tee -a FileName

This write only the Question asked by the process. Does anybody know how to write the user inputs also to the same file, synchronized?

Thanks in advance.
You can try two options.

Process1 2>&1 | tee -a filename

and, (i think better) You can start the shell vía screen and save the session to a file.

man screen.
 
Old 10-01-2010, 03:55 AM   #3
ira
LQ Newbie
 
Registered: Sep 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Hi randolf_carter,

Thank you very much for the reply.

1st option is not working as 2>&1 merge stderr to the stdout. So still the user inputs are not recorded in the log file.

2nd option, I see that "screen" is pretty similar to "script" command.

Problem here is that I issue that command "Process1 | tee -a FileName" within another shell program's prompt.( It also need to write several such commands to the same log on one request.) With the "screen" command, it quit that shell and return back to the prompt after "exit" the "screen". SO that also seem to be of no use.

Do you think it still help my scenario?
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
After log roll, Postfix cannot write to log file, Ubuntu 8.04 mboudro Linux - Server 6 09-17-2010 03:10 AM
How to write kernel log directly to a file without user action? 10110111 Linux - General 5 04-23-2009 08:29 PM
How to create a log File using tee?? rmvinodh123 Programming 1 04-12-2007 02:21 AM
multiple process write to a file tangxf Linux - General 2 11-23-2005 12:44 AM
User and Process Accounting Log Files lafinhyena Linux - Newbie 0 05-19-2004 03:57 AM


All times are GMT -5. The time now is 06:28 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration