zsh-workers
 help / color / mirror / code / Atom feed
* {var}>& redirections with complex commands
@ 2011-08-09  3:46 Bart Schaefer
  2011-08-09 18:16 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2011-08-09  3:46 UTC (permalink / raw)
  To: zsh-workers

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-10 23:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-09  3:46 {var}>& redirections with complex commands Bart Schaefer
2011-08-09 18:16 ` Peter Stephenson
2011-08-10 23:05   ` Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).