Hey.
For the form:
[n]redir-op word
2.7 Redirection, talks about n not being taken as part of the
redirection, when n is quoted.
(Not here, that that form does not require whitespace between redir-op
and word.)
It lacks the same for the {location}redir-op word form, but for that
I've already submitted #1892.
2.7.4 Here-Document, talks about what happen if any part of `word` is
quoted, but unless I'm blind, neither 2.7.5 Duplicating an Input File
Descriptor nor 2.7.6 Duplicating an Output File Descriptor explain
anything like this, nor the "main" 2.7 Redirection.
I kinda lack any specific word which says that e.g.
file='&1'
ls does-not-exist 2>"$file" | grep 'No such file or directory'
cannot be tricked into duplicating the fd, but always has to write to
the file `&1`.
Unlike of course e.g.:
file='1'
ls does-not-exist 2>&"$file" | grep 'No such file or directory'
where it is intended, that 2 shall be redirected to 1.
I mean everyone who understands shell a bit, will probably know that
this is the desired behaviour... but it doesn't seem to me that this
follows strictly from the standard, as 2.7 says nothing about quoting
of word, and 2.7.5/2.7.6 neither say that the & must be unquoted.
Would people agree to that (in which case I'd open it as a ticket), or
is it felt, that it's already strictly(!) clear from the current
wording.
Thanks,
Chris.