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 03-03-2008, 01:49 AM   #1
Michael99
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
Get stdout from a running program back to screen


Hello everybody!
I started at home a program in the background using 'setsid <program>'. Now I am at the university and I wanted to see the output the program is writing. Is it somehow possible to know, what the program is writing to stdout (and stderr) at the moment? I forgot to use something like 'setsid <program>|tee ProgOut.txt' or similiar...
Thanks for your help!
Michael
 
Old 03-03-2008, 02:58 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
I think the best (though also unnatural a bit) is using strace -p. It can be instructed to trace writes to file descriptors 1 and 2, and ‘‘-p [pid]’’ attaches it to already running program. Read its manual, maybe
Code:
strace -f -o log -s 1024 -p $(pgrep program)
will be enough for you.
 
Old 03-03-2008, 04:43 AM   #3
Michael99
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by raskin View Post
I think the best (though also unnatural a bit) is using strace -p. It can be instructed to trace writes to file descriptors 1 and 2, and ‘‘-p [pid]’’ attaches it to already running program. Read its manual, maybe
Code:
strace -f -o log -s 1024 -p $(pgrep program)
will be enough for you.
Great, thanks a lot!
 
  


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
python: how do you capture stdout stream from external program? BrianK Programming 8 01-24-2008 08:32 PM
Running program from terminal with & does nothing, program stops DittoAlex Linux - General 1 10-05-2007 01:35 AM
redirecting stdout to /dev/null and stderr to stdout? Thinking Programming 1 05-18-2006 02:36 AM
Very jolty screen when running practicaly any program bomarrow1 Linux - Software 4 05-20-2005 10:13 AM
redirect stdin/stdout of running process xtravar Linux - Software 3 03-06-2004 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:39 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
Open Source Consulting | Domain Registration