You are redirecting STDERR to STDOUT with '2>&1' and you're sending the STDOUT from the command to /dev/null with '1>/dev/null'. You then print each line of output from the command to STDOUT (which now will be the STDERR of the command) in the while loop.