From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11478 invoked by alias); 17 Sep 2011 12:27:53 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16380 Received: (qmail 17807 invoked from network); 17 Sep 2011 12:27:51 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.fr does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1316262094; bh=1j0zJpFr+d64wzlHdmz+BwPH3IBLgiN/kJSLS5nmitc=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=ohh+vyLhvYayekbaY9etpCHElU1c7Ms+B80OLWxdwuUMHft8EuO4M+KgVUkCg/t7axAj1qn2OHYB1SnlHLakTuOfzMzaMXULn/gHnNP3z2JjU6yVg4X7zcYhrJ4ebBNUyJjjuW8I4MYpuHv3e9Q1PiqkdhgyCjWWHvpj4aVHXcw= X-Yahoo-Newman-Id: 928963.10274.bm@smtp141.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: h6KurQUVM1m.Ry2656WNR_JeOaaGg9ULrLEnaBVYEVfJScI JeQYlKv_LoVPyCJnik6t0alSaZCu0YYX7i.vyJ7AYJE04H7frLnEOxO825s6 g_HsJKI8wLCR5ZAUhhu6laEZVwZNiPrWF3uP60KoxfjYkFcagGAgZjLHByVE 5APLLzWnlIZ43a94jC3vLSywKNoc3M22RGC9YECNg3hbvVYbC5nubm19hDFn I5rO447kRXYeK2XpMMwy_lQMqS54JWVOX0vGbavgB5EpYbtJvILlmHXTKluX dV0rEVV42ZHr.zkCSfHIKs9227LDLn41u8WVe8LOOX6bURmFHycLoKL2HWLy JW8A1r3wccZJlh5XEScx5cLNWu0kYixbONoAtKrTj9RWrd6ANs5gnz5nhWzb jSbrz.LZ0gzY- X-Yahoo-SMTP: V1UR0WuswBDVD1eFhM33188Ir8ciBckz4W8ZMsAh Date: Sat, 17 Sep 2011 13:21:32 +0100 From: Stephane Chazelas To: Peter Stephenson Cc: zsh-users@zsh.org Subject: Re: {fd}< and compound commands Message-ID: <20110917122132.GA10108@yahoo.fr> Mail-Followup-To: Peter Stephenson , zsh-users@zsh.org References: <20110914172148.GA7325@yahoo.fr> <20110914200601.72c91f87@pws-pc.ntlworld.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110914200601.72c91f87@pws-pc.ntlworld.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2011-09-14 20:06:01 +0100, Peter Stephenson: [...] > You need to do: > > local fd > > { > exec {fd} > while read; do > ... > done <&$fd > } always { > exec {fd}<&- > } [...] Except that if the first exec fails, that might close the wrong fd. Maybe: if command exec {fd}