Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Redirecting variable fds



>>>>> "Phil" == Phil Pennock <phil@xxxxxxxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author