zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@tiny.zanshin.com>
To: "Michael Barnes" <mibarnes@vt.edu>
Cc: zsh-users@sunsite.auc.dk
Subject: Re: redirecting stdio/stderr from a suspended then bged job
Date: Thu, 11 Mar 1999 08:28:29 -0800 (PST)	[thread overview]
Message-ID: <14055.61229.103383.508701@awayteam.zanshin.com> (raw)
In-Reply-To: <19990311105427.A6589@vt.edu>

Michael Barnes writes:
 > This has been bugging me for a while.  How can I suspend a job that is
 > taking longer than I expect and then put it in the background and then
 > redirect stdio and/or stderr to a file (or /dev/null) ?

You can't.  The I/O descriptors are all established before the job is
started the first time, and then once it is running they're completely
under the control of the job itself; the shell can't change them again.

If you think about it, it has to work this way; imagine the havoc that
could be wrought if a process couldn't guarantee that all writes to the
same descriptor are going to go to the same place.

The only thing you can do is to guess what jobs might take a long time,
and redirect their output somewhere when you start them.  If that place
is a file and you later want to see some of the output, you can run
"tail -f" or whatever.

There are some tricks you could play with named pipes or the zsh coproc,
but they all require that the redirection be specified when you first
type out the command.


  reply	other threads:[~1999-03-11 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-11 15:54 Michael Barnes
1999-03-11 16:28 ` Bart Schaefer [this message]
1999-03-12  5:06 ` Geoff Wing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14055.61229.103383.508701@awayteam.zanshin.com \
    --to=schaefer@tiny.zanshin.com \
    --cc=mibarnes@vt.edu \
    --cc=schaefer@zanshin.com \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).