From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8054 invoked from network); 10 Dec 1998 23:42:25 -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:25 -0000 Received: (qmail 13204 invoked from network); 10 Dec 1998 22:48:14 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns2.primenet.com.au with SMTP; 10 Dec 1998 22:48:14 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id RAA19992; Thu, 10 Dec 1998 17:46:15 -0500 (EST) Resent-Date: Thu, 10 Dec 1998 17:46:09 -0500 (EST) To: zsh-users@math.gatech.edu Sender: monnier@tequila.cs.yale.edu From: Stefan Monnier Newsgroups: lists.zsh.users Subject: Re: Redirecting variable fds References: <19981210215235.59487@athenaeum.demon.co.uk> Date: 10 Dec 1998 17:45:06 -0500 Message-ID: <5laf0vpqfh.fsf@tequila.cs.yale.edu> X-Newsreader: Gnus v5.5/Emacs 20.3 Path: tequila.cs.yale.edu NNTP-Posting-Host: tequila.cs.yale.edu X-Trace: 10 Dec 1998 17:45:06 -0500, tequila.cs.yale.edu Resent-Message-ID: <"bCm4K2.0.pq4.ny4Ss"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1979 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >>>>> "Phil" == Phil Pennock writes: > function bar { > DEBUGMEM_INFOFD=$1 LD_PRELOAD=./bar.so $argv[3,-1] $1>$2 > } The parsing is done before the parameter expansion so you're screwed. But there's a workaround, using eval: DEBUGMEM_INFOFD=$1 LD_PRELOAD=./bar.so eval $argv[3,-1] "$1>$2" It's not quite correct in that the content of $argv[3,-1] should be escaped to prevent its evaluation (à la "$@"), but my zsh expertise is lacking here. Stefan