Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
{var}>& redirections with complex commands
- X-seq: zsh-workers 29659
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: {var}>& redirections with complex commands
- Date: Mon, 08 Aug 2011 20:46:14 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
There are a lot of cases in which ordinary numeric redirections would be
accepted but where one cannot use these redirections. E.g. this is OK:
torch% foo() { print $one $two }
torch% foo {one}<&0 {two}<&0
11 12
But none of these are:
torch% {one}<&0 {two}<&0 foo
zsh: parse error near `{'
torch% ( print $one $two ) {one}<&0 {two}<&0
zsh: parse error near `{'
torch% { print $one $two } {one}<&0 {two}<&0
zsh: parse error near `{'
Same for various loop constructs, anonymous functions, etc.
{var} can only be used at the end of a simple command, and therefore the
only ways to reference the fd via the variable are to create the fd with
"exec" or to use a function. This should at least be clarified in the
documentation.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author