zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-users@sunsite.dk
Subject: Re: |& loses data (buffering bug?)
Date: Fri, 13 Feb 2004 16:12:51 +0000	[thread overview]
Message-ID: <20040213161251.2588a9f2@tinky-winky> (raw)
In-Reply-To: <20040213154409.GL27168@greux.loria.fr>

On Fri, 13 Feb 2004 16:44:09 +0100
Vincent Lefevre <vincent@vinc17.org> wrote:

> On 2004-02-13 16:30:31 +0100, Vincent Lefevre wrote:
> > On 2004-02-13 15:00:16 +0000, Peter Stephenson wrote:
> > > Can you get the same effect with e.g.
> > > 
> > >   perl -e 'open STDERR, ">&STDOUT";
> > >   open STDIN, "cvs status|";
> > > 
> > >   exec "less";'
> > > 
> > > which doesn't involve zsh at all?
>
> In fact, it doesn't do the same thing: STDERR is redirected to the
> terminal here.

You're right, the output from less is being redirected, not the output to
less.  Also, the tricks with pipes don't quite match what zsh is doing.
That's something more like:

perl -e 'pipe PIN, POUT;
if (fork) {
  close POUT;
  open STDIN, "<&PIN";
  close PIN;

  $_ = <STDIN>;
  exec "less";
} else {
  close PIN;
  open STDOUT, ">&POUT";
  open STDERR, ">&POUT";
  close POUT;

  $| = 1;
  print STDOUT "Sync\n";
  exec "cvs status";
}'

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


  reply	other threads:[~2004-02-13 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-13 14:15 Vincent Lefevre
2004-02-13 14:33 ` Peter Stephenson
2004-02-13 14:43   ` Vincent Lefevre
2004-02-13 15:00     ` Peter Stephenson
2004-02-13 15:30       ` Vincent Lefevre
2004-02-13 15:44         ` Vincent Lefevre
2004-02-13 16:12           ` Peter Stephenson [this message]
2004-02-13 16:17             ` Vincent Lefevre
2004-02-13 17:33 ` Vincent
2004-02-14 11:32   ` Vincent Lefevre

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=20040213161251.2588a9f2@tinky-winky \
    --to=pws@csr.com \
    --cc=zsh-users@sunsite.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).