From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11219 invoked from network); 29 Jun 2007 05:13:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Jun 2007 05:13:09 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 10558 invoked from network); 29 Jun 2007 05:13:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jun 2007 05:13:03 -0000 Received: (qmail 20897 invoked by alias); 29 Jun 2007 05:13:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23618 Received: (qmail 20809 invoked from network); 29 Jun 2007 05:12:59 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 29 Jun 2007 05:12:59 -0000 Received: (qmail 9877 invoked from network); 29 Jun 2007 05:12:59 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 29 Jun 2007 05:12:55 -0000 Received: from torch.brasslantern.com ([71.116.90.58]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JKD001W2T4W2AH1@vms040.mailsrvcs.net> for zsh-workers@sunsite.dk; Fri, 29 Jun 2007 00:12:32 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id l5T5CVkH031546 for ; Thu, 28 Jun 2007 22:12:31 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id l5T5CUR5031545 for zsh-workers@sunsite.dk; Thu, 28 Jun 2007 22:12:30 -0700 Date: Thu, 28 Jun 2007 22:12:30 -0700 From: Bart Schaefer Subject: Re: MULTIOS input In-reply-to: To: zsh-workers@sunsite.dk Message-id: <070628221230.ZM31544@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: Comments: In reply to Dave Yost "MULTIOS input" (Jun 27, 12:40pm) On Jun 27, 12:40pm, Dave Yost wrote: } } Is this working correctly? I'm on Mac OS X 10.4.10. It's not working incorrectly, I guess. I'm not sure if this is part of your question, but the <<< operator appends an implicit newline, so the newline you embedded in the quotes makes two. /dev/fd/0 refers to the standard input, which is NOT the standard input of the subshell (the pipe from "echo line 2") -- it's the standard input of "cat", which (when I try it on linux) is the <<< operator, so I see "line 1\n\n" twice. Whether that's what you get on some other OS depends on whether there really is a /dev/fd/0 or whether zsh is simulating it, and possibly on whether the I/O buffering is such that you can read the same input from the /dev/fd device more than once. } 0 298 Z% cat foo } #!/usr/local/packages/zsh/bin/zsh } } echo ZSH_VERSION is $ZSH_VERSION } } setopt MULTIOS } } echo line 2 \ } | ( } cat <<< 'line 1 } ' < /dev/fd/0 } ) } 0 299 Z% ./foo } ZSH_VERSION is 4.3.4 } line 1 } } 0 300 Z% }-- End of excerpt from Dave Yost