From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9155 invoked by alias); 9 Aug 2011 03:46:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29659 Received: (qmail 12139 invoked from network); 9 Aug 2011 03:46:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110808204614.ZM1462@torch.brasslantern.com> Date: Mon, 08 Aug 2011 20:46:14 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: {var}>& redirections with complex commands MIME-version: 1.0 Content-type: text/plain; charset=us-ascii There are a lot of cases in which ordinary numeric redirections would be accepted but where one cannot use these redirections. E.g. this is OK: torch% foo() { print $one $two } torch% foo {one}<&0 {two}<&0 11 12 But none of these are: torch% {one}<&0 {two}<&0 foo zsh: parse error near `{' torch% ( print $one $two ) {one}<&0 {two}<&0 zsh: parse error near `{' torch% { print $one $two } {one}<&0 {two}<&0 zsh: parse error near `{' Same for various loop constructs, anonymous functions, etc. {var} can only be used at the end of a simple command, and therefore the only ways to reference the fd via the variable are to create the fd with "exec" or to use a function. This should at least be clarified in the documentation.