Please see the following shell transcript:
$ ls
input.txt test-amp-gt.sh test-both-2.sh test-both.sh test-gt.sh
$ cat input.txt
input file
$ cat test-gt.sh
#! /bin/sh
cat input.txt > /dev/null && echo "DEBUG >"
$ ./test-gt.sh
DEBUG >
$ cat test-amp-gt.sh
#! /bin/sh
cat input.txt &> /dev/null && echo "DEBUG &>"
$ ./test-amp-gt.sh
DEBUG &>
$ input file
^C
$
$ cat test-both.sh
#! /bin/sh
cat input.txt > /dev/null && echo "DEBUG >"
echo "***"
cat input.txt &> /dev/null && echo "DEBUG &>"
$ ./test-both.sh
DEBUG >
***
DEBUG &>
$ input file
^C
$
$ cat test-both-2.sh
#! /bin/sh
cat input.txt &> /dev/null && echo "DEBUG &>"
echo "***"
cat input.txt > /dev/null && echo "DEBUG >"
$ ./test-both-2.sh
DEBUG &>
***
input file
DEBUG >
$
It was not clear to me as to why the redirect &> to /dev/null is apparently not working properly when the plain > is working fine. That is, in running test-amp-gt.sh, the contents of the text file should not have been output but they are. test-both-2.sh shows an even more curious behaviour of the &> -- the text should not have been output at all, but not only is it being output, but it is output after the output of the echo command on the next line!
Why is this?