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

{var}>& redirections with complex commands



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