You can check the POSIX specification. The language isn't always easy to follow, but if you know what you're looking for, you can see whether it's there or not.
POSIX includes the redirection operations N>&word and N<&word where N is an optional file descriptor number (defaulting to 0 for input and 1 for output) and word can be:
- A sequence of digits, to redirect file descriptor N to whatever is already open on word.
- The character
-, to close file descriptor N.
So >out.txt 2>&1 is a POSIX-compliant way to redirect both standard output and standard error to out.txt. It also works in pre-POSIX Bourne shells.
>& followed by a file name is an extension in some shells (including bash) that redirects both stdout and stderr to that file.
&> is nota synonym of >& followed by a file name in bash (and zsh). It has the advantage of working even if the file name is a sequence of digits or - (for example foo >&"$a" is equivalent to foo 1>&3 2>&1 if the value of a is the digit 3, but to foo >myfile 2>&1 if the value of a is myfile). Its downside is that it is incompatible with POSIX. In a POSIX-compliant shell, echo foo &>bar is parsed as the command echo foo, the & operator, and the command >bar: a background process that prints foo, and a foreground process that creates or empties the file bar.
>& followed by a file name is an extension in some shells (including bash) that redirects both stdout and stderr to that file.