SJS([EMAIL PROTECTED])@Mon, Mar 31, 2008 at 03:45:49PM -0700:
> begin  quoting Wade Curry as of Mon, Mar 31, 2008 at 03:25:56PM -0700:
> > Brad Beyenhof([EMAIL PROTECTED])@Mon, Mar 31, 2008 at 09:32:06AM -0700:
> [snip]
> > > will hold the process so I can swap manually and respond
> > > interactively to tar's request for a new tape. To do this, I
> > > first tried just prepending screen to the existing command:
> > > 
> > > /usr/bin/screen -dm tar [options] 2>{$file1} | tee {$file2}
> > 
> > <snip>
> > 
> > I can't experiment at the moment to figure this out, but I'm
> > curious what you see when you turn on screen's logging.
> > Anything informative perhaps?
> > 
> > Aside from tweaking screen until it obeys, you might try the
> > nohup utility.  I think it is much kinder to your redirections
> > and allows the command to continue after the shell exits.  You
> > won't be able to re-open a tty to manipulate it, but I didn't
> > get the impression that was important.  Between the output
> > files and ps||top, you should be able to see its progress well
> > enough with nohup.
> 
> Well, there's nohup the command, and nohup the shell built-in.
> 
> Redirections are a function of your shell.  By the time a program
> runs, all of the redirection has been dealt with.
> 
> Will _tee_ handle the closing of the output stream nicely? 
> 
> Does nohup apply to all parts of a pipe? Or would you have to put
> nohup before each piece?
> 

I wasn't aware of a shell builtin.  A cursory scan of `man
bash-builtins` didn't turn up anything about it.  The man page for
nohup, however, simply says that it makes the command ignore
hang-up signals.  The few times I've used it in the past, the
redirections were left alone.  Don't know if I've ever actually
used it with a pipe, though.

If the desire is to simply send STDOUT and STDERR to separate
files, though, then you don't really need a pipe.

nohup <command> [options] 1>filename.txt 2>otherfile.txt &

Something like the above usually does the trick for me.  I guess I
should specify /usr/bin/nohup in the future, though.

> -- This is not a pipe.
> Stewart Stremler

-- Grandpa had a pipe; he never figured out regexes because I
     always blew out his matches.
Wade Curry
syntaxman


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to