Here is a shell puzzle I can't answer (bash).
This returns exit code 1:
ping $HOSTNAME -c2 -W2 2&>1 > /dev/null
This returns the correct exit code every time (2, 1 or 0).
ping $HOSTNAME -c2 -W2
Why is the first one always returning 1? I'm just trying to hide/throwaway all the output of the ping command.