I am writing a script that will make sure I can telnet to a box that has an intermittent problem. When this problematic situation occurs, I can ping the box but I cant telnet to it. My script does something like:
telnet sp18 1>/tmp/telnet.out 2>&1
I then grep telnet.out for a string. The problem that I am having is that the telnet command makes the script hang(at a login prompt,of course) so, I want to send a ctrl + c sequence so that the script can continue and then exit