The following shell script works only for first server and does not loop to the next. I tried 0< before the ssh command but it still does not return to the shell script once connected.
#!/bin/sh
while read IP
do
ssh root@10.0.0.10 " ssh root@$IP 'ls -lht /log/cdr-csv/ ' " > /tmp/$IP.txt
done << here_doc
18.17.6.19
18.17.10.24
here_doc
How do I run the same command on the second server 18.17.10.24 ?