Phillip Susi wrote:
> Pádraig Brady wrote:
> >That's not possible unfortunately, as nohup just
> >sets things up, and replaces itself with the command.
> 
> Of course it is possible; nohup knows its pid as well as the command it 
> is asked to run.  When it opens the output file it just needs to use 
> that information to name it.

Well, perhaps in a sense *anything* is possible with enough code to
implement it.  However as originally designed and currently written it
is not possible for nohup to do this.  It is only possible for nohup
if it were rewritten to be a completely different program.  It would
need to be an active participant in the I/O.  And I would hate to
invalidate all of the Unix documentation written to date on nohup.

But I don't think that is needed.  For active participation in the I/O
I would suggest one of the scripting languages.

Example:

  ruby -le 'IO.popen("foo").each_line { |l| puts l.sub(/^/,"foo: ") }'

Also note that if the program 'foo' buffers output then programs
processing it won't get the output as it happens but instead would get
it in larger chunks as the buffers are flushed out.

Bob


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to