From owner-freebsd-questions@FreeBSD.ORG Sun Jun 12 23:47:17 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE3CA16A41C for ; Sun, 12 Jun 2005 23:47:17 +0000 (GMT) (envelope-from mwm-dated-1119484035.3eb731@mired.org) Received: from delight.idiom.com (delight.idiom.com [216.240.32.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7830F43D1D for ; Sun, 12 Jun 2005 23:47:17 +0000 (GMT) (envelope-from mwm-dated-1119484035.3eb731@mired.org) Received: from idiom.com (idiom.com [216.240.32.1]) by delight.idiom.com (Postfix) with ESMTP id AB1CC1F6547 for ; Sun, 12 Jun 2005 16:47:16 -0700 (PDT) Received: from mired.org (mwm@idiom [216.240.32.1]) by idiom.com (8.12.11/8.12.11) with SMTP id j5CNlFL0034848 for ; Sun, 12 Jun 2005 16:47:16 -0700 (PDT) (envelope-from mwm-dated-1119484035.3eb731@mired.org) Received: (qmail 39126 invoked by uid 1001); 12 Jun 2005 23:47:15 -0000 Received: by guru.mired.org (tmda-sendmail, from uid 1001); Sun, 12 Jun 2005 18:47:15 -0500 (CDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17068.51586.885638.130044@guru.mired.org> Date: Sun, 12 Jun 2005 18:47:14 -0500 To: Christopher Black In-Reply-To: <1118608948.705.6.camel@localhost> References: <17067.62149.92183.56827@guru.mired.org> <1118608948.705.6.camel@localhost> X-Mailer: VM 7.17 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer Cc: questions@freebsd.org Subject: Re: Problems with command line scratch files in zsh X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2005 23:47:17 -0000 [Format recovered from top posting.] In <1118608948.705.6.camel@localhost>, Christopher Black typed: > On Sun, 2005-06-12 at 03:31 -0500, Mike Meyer wrote: > > Since going to 5.x with devfd, I've noticed that some of the shell > > constructs used by zsh (and other shells - I know zsh didn't invent > > this) quit working. To wit: > > > > guru% wc <(cat /etc/motd) > > wc: /dev/fd/11: open: No such file or directory > > > > The <(...) construct runs the pipe in (), and replaces the <(...) with > > the name of the /dev/fd/ entry for the output of that pipe. The file > > exists for the shell process doing all this. But when the comm process > > tries to open the file to read the data, the file doesn't exist. This > > is pretty nasty. > > > > Anyone got any suggestions on how to fix this? A bug report with a > > patch, maybe (I couldn't find any such bug report)? Workarounds? Maybe > > this should go to hackers@freebsd.org? > Why not just 'cat /etc/motd | wc' ? Because I used a trivial example designed to illustrate the problem. A less trivial example would be: comm -12 <(sort file_one) <(sort file_two) Of course, this can also be rewritten using temp files instead of pipes. But that will be longer, slower, and uglier. This worked on 4.X. It ought to work on 5.X. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.