Loop Expect statement
I have the below expect statement:
spawn ssh email@example.com
expect "firstname.lastname@example.org's password:"
send "conf t\r"
send "wr m\r"
what i would like to do is run this on over 200 devices. I have a txt file that has all the IPs (separated by carriage returns) . Im thinking the best thing that i need to do is create a for loop or while loop until the end of file.
Can someone please help me create a loop. I also need to know how to import ips from the txt file.
Thank you very much!