Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Redirecting variable fds
- X-seq: zsh-users 1978
- From: Phil Pennock <phil@xxxxxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxxxxxxx>
- Subject: Redirecting variable fds
- Date: Thu, 10 Dec 1998 21:52:35 +0000
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxxxxxxxxxx>
- Organisation: Organisation? Here? No, over there ---->
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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author