zsh-users
 help / color / mirror / code / Atom feed
From: Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
To: Andre Pang <ozone@algorithm.com.au>
Cc: zsh-users <zsh-users@sunsite.auc.dk>
Subject: Re: { foo=bar; command; } | othercommand; echo $foo == no output?
Date: Thu, 19 Apr 2001 09:10:36 +0400 (MSD)	[thread overview]
Message-ID: <Pine.SV4.4.33.0104190905120.2959-100000@itsrm2.mow.siemens.ru> (raw)
In-Reply-To: <20010419133634.A5425@exodus>

On Thu, 19 Apr 2001, Andre Pang wrote:

> I have a problem,  I want to tee and still get the return code:
>
>   prog  x y z | tee
>   echo $?
>

In recent enough zsh (4.0.1-pre-3 is the latest version) you can use
$pipestatus:

pipestatus <S> <Z>
     An array containing the exit values returned by all commands in the
     last pipeline.

bor@itsrm2:~%> cat /foo/bar | tee
cat: Cannot open /foo/bar: No such file or directory
bor@itsrm2:~%> print $pipestatus
2 0

-andrej




      reply	other threads:[~2001-04-19  5:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-19  3:36 Andre Pang
2001-04-19  5:10 ` Andrej Borsenkow [this message]

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=Pine.SV4.4.33.0104190905120.2959-100000@itsrm2.mow.siemens.ru \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=ozone@algorithm.com.au \
    --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).