I just noticed the
ping command always returns zero exit code in cygwin.
I installed it as a package
$ ping 192.168.0.102 -c 1 PING 192.168.0.102 (192.168.0.102): 0 data bytes 36 bytes from 192.168.0.11: icmp_type=3 (Dest Unreachable) icmp_code=1 ----192.168.0.102 PING Statistics---- 1 packets transmitted, 0 packets received, 100.0% packet loss vlastimil@vb-nb-windows ~ $ echo $? 0
$ echo $? 1
ping package contains non-standard version of
ping command, which obviously behaves as described in the question.
I tried to uninstall this package and install
inetutils instead, but there seems to be no
How can I go about solving this issue? (a wrapper, etc.)
The answer should be written in POSIX for portability. Sorry for forgetting about it.