From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6549 invoked from network); 19 Apr 2001 03:38:59 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Apr 2001 03:38:59 -0000 Received: (qmail 5884 invoked by alias); 19 Apr 2001 03:38:20 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3823 Received: (qmail 5868 invoked from network); 19 Apr 2001 03:38:19 -0000 Date: Thu, 19 Apr 2001 13:36:34 +1000 From: Andre Pang To: zsh-users Subject: { foo=bar; command; } | othercommand; echo $foo == no output? Message-ID: <20010419133634.A5425@exodus> Mail-Followup-To: zsh-users Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.17i 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 - trust.in.love.to.save