I'm running the following command to retrieve the exit status. I don't actually need/want any of the command output.
Note the redirect of STDOUT AND STDERR to /dev/null. So I expect not to see anything.
It works fine when the host is pingable. But if the host is not pingable, the error still displays
I've tried this other variation, to the same effect:
I'm using LMDE5. Is this happening in other distros, or ping versions?
Bash:
ping -q -c 1 computer.local 2>&1 > /dev/null
It works fine when the host is pingable. But if the host is not pingable, the error still displays
Code:
ping: computer.local: Name or service not known
I've tried this other variation, to the same effect:
Bash:
ping -q -c 1 computer.local 2 > /dev/null > /dev/null
I'm using LMDE5. Is this happening in other distros, or ping versions?