telnet script help

Hi Guys,

How do I write the script for the following

telnet 192.168.1.100 9002

if the result is less than 1 second. The script should say as port open

if the result takes more than 3 seconds. The script should display as port closed.

Thanks,
Charan

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.