zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: exec >& >(tee hello)
Date: Thu, 28 Mar 2013 08:46:39 -0700	[thread overview]
Message-ID: <130328084639.ZM28782@torch.brasslantern.com> (raw)
In-Reply-To: <1364325715.29901.140661209502305.67203343@webmail.messagingengine.com>

On Mar 26,  3:21pm, Anthony Heading wrote:
}
} On zsh  (5.0 and 4.2.6 -   rhel5 x64),  this command hangs:
}       zsh -c 'exec >& >(tee hello)'
} It seems to work OK with bash.

Define "work".

Zsh is waiting for "tee hello" to finish.  It's part of the current
command line, and nothing was put in the background, so the current
command is in the foreground until all parts of it finish.  From a
job management perspective this is the same as

    { exec >& } | tee hello

Perhaps

    exec >& >(tee hello &)

is what you want?

(Older versions of zsh put >(...) entirely in the background rather
than treat them as a component of the command line, but that led to
race conditions and processes still running after the parent shell
exited and various other confusion.)

However, there does seem to be a signal-handling bug with your original
command.  When run in an interactive shell, it probably ought to be
possible to interrupt or suspend the >(...) once zsh gets to the point
of waiting for it, but that doesn't work.

Note that both bash and zsh will exit on a SIGPIPE if the tee is killed.


  reply	other threads:[~2013-03-28 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 19:21 Anthony Heading
2013-03-28 15:46 ` Bart Schaefer [this message]
2013-03-28 21:57   ` Phil Pennock
2013-03-28 22:46     ` Bart Schaefer

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=130328084639.ZM28782@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).