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

Re: PATCH: functions with redirections



On Oct 2,  9:35am, Peter Stephenson wrote:
}
} > } +function is executed.  Any variables in the redirection are expanded
} > } +at the point the function is executed, but outside the function scope.
} > 
} > ... is actually the way it's supposed to work.

Bash appears to evaluate the redirects IN the function scope:

$ foo() { echo bar; } >$1
[schaefer@torch zsh-5.0-build]$ foo
$1: ambiguous redirect
$ foo /dev/null
$ 



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