Guillem Jover wrote:
[...]
In the original mail I referred to redirecting to the same file, and
not file descriptor. Anyway the problem comes with something like:

 echo foo >&/dev/null
 echo foo &>/dev/null

Those will fail in dash (for example), and as can bee seen from SUSv3
the only supported tokens after [n]>& are digits or '-'. Anything else
gets an unspecified behaviour. I guess the biggest problem is that
word can be anything which at the end expands to those valid tokens.

Yeah, you're right; I should have read the relevant section of SUS more closely.

I've now implemented a check for >& or <& followed by anything other than - or a string of digits. I've left the check for bare &> in place, as that's a bashism regardless of the surrounding context.

Adam



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to