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

Re: multi-digit file descriptors



On Feb 12, 11:16am, Vincent Lefevre wrote:
} Subject: Re: multi-digit file descriptors
}
} On 2015-02-11 09:27:51 -0800, Bart Schaefer wrote:
} > Zsh reserves descriptors 10 and up for internal use; for example, 10 is
} > nearly always a copy of the original input terminal in an interactive shell.
} 
} But this doesn't explain the error message, in particular...
} 
} ( echo foo >&09; ) 09>my_file
} 
} still gives an error:
} 
} redir:4: parse error near `09'

"09>my_file" is parsed as "09" ">" "my_file", because zsh doesn't support
multi-digit descriptors on the left side of a redirect.  So what you have
is the same as

  { ( echo foo >&09 ) 09 } > my_file

Which is a parse error because you can't follow a subshell with an argument
list.

Zsh does support multi-digit descriptors on the right side, so >&09 is all
one token (and is the same as >&9 in this case).



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