From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8021 invoked from network); 10 Dec 1998 23:42:21 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (7795@203.24.36.3) by ns1.primenet.com.au with SMTP; 10 Dec 1998 23:42:21 -0000 Received: (qmail 13096 invoked from network); 10 Dec 1998 21:52:31 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns2.primenet.com.au with SMTP; 10 Dec 1998 21:52:31 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id QAA17763; Thu, 10 Dec 1998 16:50:09 -0500 (EST) Resent-Date: Thu, 10 Dec 1998 16:50:02 -0500 (EST) Message-ID: <19981210215235.59487@athenaeum.demon.co.uk> Date: Thu, 10 Dec 1998 21:52:35 +0000 From: Phil Pennock To: Zsh Users Subject: Redirecting variable fds Mail-Followup-To: Zsh Users Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 Organisation: Organisation? Here? No, over there ----> X-Disclaimer: Any views expressed in this message, where not explicitly attributed otherwise, are mine and mine alone. Such views do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. X-Phase-of-Moon: The Moon is Waning Crescent (49% of Full) Resent-Message-ID: <"RuiCA1.0.6L4.A84Ss"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1978 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Okay, I'm stumped. I'm trying to write a function which has as one of its arguments a file-descriptor, which should be redirected to another arg. My attempt is: function bar { DEBUGMEM_INFOFD=$1 LD_PRELOAD=./bar.so $argv[3,-1] $1>$2 } bar 5 test.out some-command and-an-arg Unfortunately, somewhere in parsing, the ``$1>$2'' bit expands out to become ``5 > test.out'' which adds an extra arg and redirects stdout. By quick-hack was to just shove it onto the input buffer: function bar { print -z DEBUGMEM_INFOFD=$1 LD_PRELOAD=./bar.so $argv[3,-1] "$1>$2" } and then press return. This is not exactly optimal. What am I doing wrong? Is there something I'm missing or is this the best solution? Thanks, -- --> Phil Pennock ; GAT d- s+:+ a22 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++ E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+ G+ e+ h* r y?