Help answer threads with 0 replies.
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 04-30-2003, 03:34 AM   #1
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?

Old 04-30-2003, 09:30 AM   #2
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 --


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 05:37 PM
Redirecting output of running command tommyr1216 Linux - General 3 03-04-2005 08:20 PM
Redirecting mplayer output driptray Linux - Software 1 10-12-2004 07:42 AM
redirecting output in Bourne shell trutnev Linux - Software 2 04-22-2004 03:55 AM
redirecting xmms output durden2.0 Linux - Software 0 03-06-2004 07:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:59 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