Telnet redirecting

Hey guys,

i want to be able to get rid of the following output that telnet spits out to the terminal. i have a script that runs telnet to about 5 hosts and checks to make sure connectivity works.

Connection closed by foreign host.
Connection closed by foreign host.
Connection closed by foreign host.
Connection closed by foreign host.

how can i do this? i dont want the script to spit this stuff out and grepping -v doesnt work to get rid of it.

A line from the script that involves telnet is:

echo ^C\n | telnet $line $PORT | grep "Connected"

It's going to stderr, 2

One way is dump all error messages into /dev/null

echo ^C\n | telnet $line $PORT 2>/dev/null | grep "Connected"

thank you so much!!! this seems to work.