zsh-users
 help / color / mirror / code / Atom feed
From: Andre Pang <ozone@algorithm.com.au>
To: zsh-users <zsh-users@sunsite.auc.dk>
Subject: { foo=bar; command; } | othercommand; echo $foo == no output?
Date: Thu, 19 Apr 2001 13:36:34 +1000	[thread overview]
Message-ID: <20010419133634.A5425@exodus> (raw)

g'day all,

a mate is maving a problem with the following, and i tried the
behaviour under zsh and it doesn't work either.  is there a
reason why this doesn't work?  and what would be a good
solution?  (i suggested setopt multios; prog x y z > /dev/stdout
> filename)

thanks zsh gurus!


----- Forwarded message from waratah@zip.com.au -----

From: waratah@zip.com.au
To: slug-chat@slug.org.au
Date: Thu, 19 Apr 2001 01:59:54 GMT
Subject: [slug-chat] Script challenge with tee
Envelope-to: andrep@localhost
X-Mailer: Endymion MailMan Standard Edition v3.0.26


I have a problem,  I want to tee and still get the return code:

  prog  x y z | tee
  echo $?

Will always show zero because this is the return code of tee.  I need the 
return value of prog.

{
  prog x y z
  echo $?
} | tee

works but I want to capture the values so that I can exit much later with the 
value of this program.

{
   prog x y z
   RC=$?
}  | tee

  lp ...

exit $RC

RC is does not appear to be available to the script.

Any suggestions?

KenF

---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug-chat


----- End forwarded message -----

-- 
#ozone/algorithm <ozone@algorithm.com.au>          - trust.in.love.to.save


             reply	other threads:[~2001-04-19  3:38 UTC|newest]

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

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=20010419133634.A5425@exodus \
    --to=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).