From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11715 invoked from network); 17 Jun 2004 13:58:00 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 17 Jun 2004 13:58:00 -0000 Received: (qmail 25625 invoked from network); 17 Jun 2004 13:57:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jun 2004 13:57:13 -0000 Received: (qmail 3467 invoked by alias); 17 Jun 2004 13:56:49 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7556 Received: (qmail 3456 invoked from network); 17 Jun 2004 13:56:49 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 17 Jun 2004 13:56:46 -0000 Received: (qmail 23858 invoked from network); 17 Jun 2004 13:56:11 -0000 Received: from madrid10.amenworld.com (62.193.203.32) by a.mx.sunsite.dk with SMTP; 17 Jun 2004 13:56:10 -0000 Received: from DervishD.pleyades.net (212.Red-80-35-44.pooles.rima-tde.net [80.35.44.212]) by madrid10.amenworld.com (8.10.2/8.10.2) with ESMTP id i5HDu2d09154 for ; Thu, 17 Jun 2004 15:56:03 +0200 Received: from raul@pleyades.net by DervishD.pleyades.net with local (Exim MTA 2.05) id <1BaxLj-0005r3-00>; Thu, 17 Jun 2004 15:54:39 +0200 Date: Thu, 17 Jun 2004 15:54:39 +0200 From: DervishD To: Zsh Users Subject: Double input and 'exec' builtin Message-ID: <20040617135439.GA22462@DervishD> Mail-Followup-To: Zsh Users Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.1i Organization: Pleyades X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Hi all :) I have a script that processes standard input and after that prints some data and waits for user input, something like: #!/bin/zsh emulate -L zsh select ITEM in `filter` do print $ITEM break; done # End of script Obviously this doesn't work, because 'select' needs standard input (or the line editor) to read the user selection, but 'filter' processes standard input as well!. Well, I've modified it like this: #!/bin/zsh emulate -L zsh set `filter` select ITEM do print $ITEM break; done # End of script thus separating the filter processing from the selection, but it doesn't work either. I need to do the following in order to make it work: #!/bin/zsh emulate -L zsh set `filter` exec < /dev/tty select ITEM do print $ITEM break; done # End of script Is there any cleaner way of doing all this? I want to solve two problems. First, the 'set' part. I don't really want to use the positional parameters for this, although they won't be used in this script. I've thought about using a shell parameter instead of 'set' and positional parameters, and using ${(f)that_variable} for generating the list for 'select'. The other problem is separating the part of the script that processes standard input from the select, without making two scripts and without that 'exec'. Any idea? Thanks a lot for your help :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/