From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27952 invoked from network); 7 Jun 2006 13:17:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Jun 2006 13:17:53 -0000 Received: (qmail 15337 invoked from network); 7 Jun 2006 13:17:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Jun 2006 13:17:45 -0000 Received: (qmail 25742 invoked by alias); 7 Jun 2006 13:17:37 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10357 Received: (qmail 23211 invoked from network); 7 Jun 2006 12:50:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Jun 2006 12:50:56 -0000 Received: (qmail 92121 invoked from network); 7 Jun 2006 12:50:56 -0000 Received: from sophia.inria.fr (138.96.64.20) by a.mx.sunsite.dk with SMTP; 7 Jun 2006 12:50:55 -0000 Received: from localhost (localhost [127.0.0.1]) by sophia.inria.fr (8.13.6/8.13.4) with ESMTP id k57CosW7026215 for ; Wed, 7 Jun 2006 14:50:54 +0200 Received: from [138.96.90.13] (trinidad.inria.fr [138.96.90.13]) by sophia.inria.fr (8.13.6/8.13.4) with ESMTP id k57CogWK026119 for ; Wed, 7 Jun 2006 14:50:42 +0200 Message-ID: <4486CBA2.9030501@yahoo.fr> Date: Wed, 07 Jun 2006 14:50:42 +0200 From: Guillaume Chazarain User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: zsh-users@sunsite.dk Subject: Bi-directional pipe Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (sophia.inria.fr [138.96.64.20]); Wed, 07 Jun 2006 14:50:42 +0200 (MEST) X-Virus-Scanned: by amavisd-new at sophia.inria.fr Hi, Is there a way to make a bi-directional pipe in zsh? That is, something like: foo | bar doing implicitly bar | foo, so foo stdin <- bar stdout and foo stdout <- bar stdin Here is an example of what I want to do: #!/bin/zsh mkfifo fifo exec 4>&1 ( exec 0&4 done ) | bc -q > fifo The script enclosed between parenthesis writes and read to/from bc. This approach uses a FIFO, so I would have hoped for a solution to avoid needing a writable part of the filesystem ;-) Maybe there is a magic incantation I can substitute to the | in order to have a bi-directional pipe, or some function to create a pipe that I would redirect to. Thanks in advance for any help. -- Guillaume