nc tool different on different dists - seriously?

theBlueSage tbs-Gb/NUjX2UK8 at public.gmane.org
Fri Oct 8 17:14:08 EDT 2010


Hi folks, 

I am constantly switching between my ubuntu system on my desktop, and
our CentOS servers at work. This is the first time I have come across a
difference that broke a script ...

I use the tool 'nc' to to check the status of memcached caches on my
servers In production (CentOS) this works :

echo "stats" | nc localhost 11211

however it fails on the ubuntu machine. The ubuntu machine requires an
option

echo "stats" | nc -q1 localhost 11211

so I added that ' -q1' option to the script. Which in turn broke the
script on CentOS, which complains that there is no '-q' option.

After 'man'ing the tool on both machines it appears the CentOS version
truly does not have the '-q' option, and that the Ubuntu version really
needs it. 

How is it possible that such a nice tool can get soooo messed up? Anyone
know a way around this?

thanks

Richard






More information about the Discuss mailing list