http://www.cocoachina.com/articles/51080 这将运行不超过2秒: echo quit | timeout --signal=9 2 telnet [SERVER] [PORT]