LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   redirect stdin/stdout of running process (https://www.linuxquestions.org/questions/linux-software-2/redirect-stdin-stdout-of-running-process-153991/)

xtravar 03-05-2004 07:35 PM

redirect stdin/stdout of running process
 
Is there a way to redirect standard input and output after a process is running? I'm well aware of how to do it when starting a process; however, what I want to do is 'check up' on a program that's running under a separate session or in the background.

Google failed me on this one so I thought I'd try here.

Thanks in advance.

Snags 03-05-2004 07:45 PM

Checking up on a process
 
I don't know of a way to attach to the standard input/output of a process, unless it is in the /proc filesystem. But to check up on a running process, I tend to do the following:

command > output
tail -f output

Then I can log in remotely and tail the output, even if it is still scrolling on the original screen.

-Snags

cetialphav 03-06-2004 06:45 PM

Yeah I usually use tail, too. But sometimes you need something more powerful and sophisticated.

That is where screen comes in. It has some very powerful capabilities and it is probably already installed. At least it is for me.

Quote:

[todd@perl]$ rpm -qi screen
Name : screen Relocations: (not relocateable)
Version : 3.9.15 Vendor: Red Hat, Inc.
Release : 11 Build Date: Thu Jul 10 15:25:18 2003
Install Date: Sat Dec 27 20:37:03 2003 Build Host: porky.devel.redhat.com
Group : Applications/System Source RPM: screen-3.9.15-11.src.rpm
Size : 738578 License: GPL2
Signature : DSA/SHA1, Tue Oct 28 17:40:14 2003, Key ID b44269d04f2a6fd2
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL : http://www.gnu.org/software/screen
Summary : A screen manager that supports multiple logins on one terminal.
Description :
The screen utility allows you to have multiple logins on just one
terminal. Screen is useful for users who telnet into a machine or are
connected via a dumb terminal, but want to use more than just one
login.

Install the screen package if you need a screen manager that can
support multiple logins on one terminal.

xtravar 03-06-2004 07:54 PM

Screen is exactly what I was looking for. Thanks.


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