In the below script, i want to check telnet port status of list of servers, here where ever port working i am getting output. where ever port is not working (where ever trying) there it's command stuck, there it's needed manual interruption like ctrl+c.
without interception i want run this command and i want to know in which ip telnet is working and where it's not woring
like echo $? {if [ $? -eq 0 ];then echo working;else echo notworking;fi
for i in `cat conect_ser_05-13-19`;
do
echo ----- $i ---;
ssh $i "TERM=vt100;export TERM;echo sleep|telnet unix.com 8089"
done