LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 04-30-2003, 04:34 AM   #1
mhelles
LQ Newbie
 
Registered: Apr 2003
Posts: 1

Rep: Reputation: 0
Redirecting process output to shell


I've got a Java program (JRun, actually) that spawns multiple threads (shown as processes when using the "ps" command). I am interesting in seeing the output of *one* of these threads.

The main program outputs into an output log that I don't have any control over . And I *only* want to see the output of *one* of the threads of the main program.

My question is: How do I redirect the output of a single running thread to the current shell so that I can watch it?

Morten
 
Old 04-30-2003, 10:30 AM   #2
shadowbird
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15
The short answer is that you can't. The threads will inherit the standard input, output, and error streams from their parent.

The long answer is that you can do it but it will require that you do some programming. You can eitther use the excellent JLog facility (look on the Apache/Jakarta website for JLog) OR in the thread, you can have it open its own output file and write to that.

-- Kevin --
 
  


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
shell script to read ps -e output and determine process double processes. dr_zayus69 Programming 1 09-21-2005 06:37 PM
Redirecting output of running command tommyr1216 Linux - General 3 03-04-2005 09:20 PM
Redirecting mplayer output driptray Linux - Software 1 10-12-2004 08:42 AM
redirecting output in Bourne shell trutnev Linux - Software 2 04-22-2004 04:55 AM
redirecting xmms output durden2.0 Linux - Software 0 03-06-2004 08:29 PM


All times are GMT -5. The time now is 04:31 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration