Re: Redirecting stdout of running program



In article
<0f52ea5d-2f27-4f9d-8bf4-fe0cac344999@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
David Schwartz <davids@xxxxxxxxxxxxx> wrote:
Is there any way to redirect the stdout of a running program?

(please don't suggest me to redirect output in advance or to use nohup:
this is obvious but I am speaking for the case when the program runs
much longer than it was expected)

No, and for fairly good reasons. The program may check early in its
run whether it's writing to a terminal or a file, and may fail if
operations specific to that type later fail.

That isn't a fairly good reason, for a Unix-like system. The Unix
philosophy includes giving us sharp tools, and leaving it up to us to
use them without cutting ourselves. Not providing a tool because some
people might use it in ways that might confuse some programs is not the
Unix way.

--
--Tim Smith
.



Relevant Pages

  • Re: How to find an end of file
    ... You said that on Unix like system, the attempt to read may fail due to ... two reasons: 1) Some Error Condition 2) end-of-file occurred. ...
    (comp.lang.c)
  • Re: NT/2000 vs Unix based Web Servers
    ... There are about a million good reasons to switch. ... easily run Apache on say Red Hat 7.3 on a machine half what you have for IIS ... NT/2000 vs Unix based Web Servers ...
    (Security-Basics)
  • Re: Obtaining random seeds
    ... >> but some won't just do that, for a variety of reasons. ... > Do you mean some specific very old Unix versions? ... > the user (say to gather keystroke timings at boot time) ... If they want to do public-key cryptography with pencil ...
    (sci.crypt)
  • Re: long time Linux user considering switching to OS-X
    ... at Linux/Unix users. ... OSX is BSD Unix. ... The main reasons I hear for using a Mac are: ...
    (comp.sys.mac.portables)
  • Re: black ice usage question
    ... > reasons for or against me making this switch? ... but any FW will fail a test if not configured properly. ... PING test was initiated/solicited by the computer BI was on. ... on the Internet from behind the Linksys router using the DMZ of the router. ...
    (comp.security.firewalls)