Code:
while read IP
do
rm -f rbtdate.txt
rm -f rbt.txt
ssh -n $usr@$IP 'hostname;date +%T;head -1 /dev/ttyS1;uptime;last reboot|head -30' >rbt.txt
host=`head -1 rbt.txt|cut -c 5-8`
RSUname=`_RSUhostname`
This is the part of my script to do some commands via ssh and show some outputs, when I run it with IP rang in 192.168.40.X, it works correctly! But when I run it with 10.8.0.X, it remains in the orange line! and I should press Ctrl+c to continue the script and reading next IP via the loop.Before that the next IP would be read, the output is shown, but I want to run it automatically without pressing Ctrl+c !