Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-13-2008, 09:49 AM   #1
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.

Old 05-13-2008, 10:03 AM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
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.


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 > Forums > Linux Forums > Linux - Newbie

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

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