07-02-2007
afaik, you cannot do that. Once the process starts with all the file descriptors in place, unix will not allow you to do this. You can setup some sort of mechanism where on receiving a signal, your process also writes whatever it is writing to stdout to another file.
But it will be a lot of work, so it just might make more sense to redirect stdout to a file and keep truncating it every so often (you could have a cronjob) till you need to see what the process is doing. When you do, stop truncating the file and whatever you need to check is just waiting in that file.
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am fairly new to Unix Terminal outputs and I have a server that is sending print jobs to a PortServer 8 RJ45 situated in a remote location. It is working fine however we need to change the Subnet of that location and I am unable to find where the IP associated with the terminal is located.
... (4 Replies)
Discussion started by: martin_Montreal
4 Replies
2. AIX
Hi All
can anyone tell me what is the meaning of tty,or give me an example of this? (1 Reply)
Discussion started by: magasem
1 Replies
3. AIX
Hi ,
Can you suggest me how to back to back printing in UNIX? Is there any way?
Kindly advise.
Regards
Vijaya Amirtha Raj (3 Replies)
Discussion started by: amirthraj_12
3 Replies
4. UNIX for Dummies Questions & Answers
I have put the file descriptor 1 to file, using command exec 1>>out.txt
Then I could not see any output on the screen, how could I restore the default output to terminal? :mad: Thanks (3 Replies)
Discussion started by: biglau
3 Replies
5. IP Networking
Hi every body,
Is it possible to connect two servers Back-to-Back (Point-to-Point) using HBA adapters & using Fiber.
Note it is direct connection & there is no switches between the servers.
I'm concern about using HBA adapters, it is possible or not.
Thanks in advance. :) (3 Replies)
Discussion started by: aldowsary
3 Replies
6. Programming
In my program, I am using library provided by other. In the library, the cout/cerr is redirected to a file (the file path is known).
After I call some methods in the library, I get one side-effect --> The cout/cerr in my own program is also directed to the file.
So how can I to redirect... (5 Replies)
Discussion started by: princelinux
5 Replies
7. UNIX for Advanced & Expert Users
I am not sure if I am using the correct terminology but somehow my tty keeps changing on me. The man pages are confusing to me on what exactly the tty is. This is what I see when I run the tty command. Could anyone explain why my tty keeps changing?
~ $ tty
/dev/pts/1
~ $ tty
/dev/pts/0 (6 Replies)
Discussion started by: cokedude
6 Replies
8. Shell Programming and Scripting
In bash, you can do something like this:
#!/bin/bash
echo -n "What is your name? " > /dev/tty
read thename < /dev/tty
How can I do the same in python?
I have a python script that has the following content:
#!/usr/bin/python2.7
import getpass
import sys
import telnetlib
import... (2 Replies)
Discussion started by: SkySmart
2 Replies
LEARN ABOUT MOJAVE
mount_fdesc
MOUNT_FDESC(8) BSD System Manager's Manual MOUNT_FDESC(8)
NAME
mount_fdesc -- mount the file-descriptor file system
SYNOPSIS
mount_fdesc [-o options] fdesc mount_point
DESCRIPTION
The mount_fdesc command attaches an instance of the per-process file descriptor namespace to the global filesystem namespace. The conven-
tional mount point is /dev and the filesystem should be union mounted in order to augment, rather than replace, the existing entries in /dev.
This command is normally executed by mount(8) at boot time.
The options are as follows:
-o Options are specified with a -o flag followed by a comma separated string of options. See the mount(8) man page for possible options
and their meanings.
The contents of the mount point are fd, stderr, stdin, stdout and tty.
fd is a directory whose contents appear as a list of numbered files which correspond to the open files of the process reading the directory.
The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. If the file descriptor is
open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call:
fd = open("/dev/fd/0", mode);
and the call:
fd = fcntl(0, F_DUPFD, 0);
are equivalent.
The files /dev/stdin, /dev/stdout and /dev/stderr appear as symlinks to the relevant entry in the /dev/fd sub-directory. Opening them is
equivalent to the following calls:
fd = fcntl(STDIN_FILENO, F_DUPFD, 0);
fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
fd = fcntl(STDERR_FILENO, F_DUPFD, 0);
Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are ignored.
The /dev/tty entry is an indirect reference to the current process's controlling terminal. It appears as a named pipe (FIFO) but behaves in
exactly the same way as the real controlling terminal device.
FILES
/dev/fd/#
/dev/stdin
/dev/stdout
/dev/stderr
/dev/tty
SEE ALSO
mount(2), unmount(2), tty(4), fstab(5), mount(8)
CAVEATS
No ~. and .. entries appear when listing the contents of the /dev/fd directory. This makes sense in the context of this filesystem, but is
inconsistent with usual filesystem conventions. However, it is still possible to refer to both ~. and .. in a pathname.
This filesystem may not be NFS-exported.
HISTORY
The mount_fdesc utility first appeared in 4.4BSD.
4.4BSD March 27, 1994 4.4BSD