LinuxQuestions.org
Help answer threads with 0 replies.
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 05-13-2008, 09:49 AM   #1
ponezhil
LQ Newbie
 
Registered: May 2008
Posts: 1

Rep: Reputation: 0
to collect logs from xterm window.


Hi all,

I am running a bash script on xterm wimdow. Now
i need to collect the logs from the xterm window.

my script

{
system ("xterm $bash_script");
.....
.....
}

Now I need to put the contents on xterm to a log file.

Please let me know how to redirect xterm contents to a log file.

regards,
Ezhil
 
Old 05-13-2008, 10:03 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Is your code fragment a piece of C code? If yes, then you can use popen() instead of system, and read back from the child process. The stuff you read back can then be written to a file of your choice.
man popen
If you want to do the work at a higher level, you could run a screen session in the xterm, and use its logging capabilities to capture the output of your script.
--- rod.
 
  


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
X Window/Xterm from Fedpra egurski Solaris / OpenSolaris 2 06-27-2005 10:17 PM
Xterm window Font Cort Linux - Newbie 8 09-18-2004 02:56 PM
X Window/Xterm from Fedora egurski Fedora 1 09-15-2004 04:13 PM
New XTerm Window in C palbert Programming 1 11-24-2003 03:12 AM
Can you collect virus logs from Windows machines to a Linux box jongun78 Linux - General 1 11-14-2003 05:33 PM


All times are GMT -5. The time now is 04:16 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration