I am trying to achieve a certain expect script I have a txt file..
It contains data like
1 ip telnetname slot1 slot2 assoc1 assoc2 mep1 mep2
2 ip telnetname slot1 slot2 assoc1 assoc2 mep1 mep2
I want to make an expect script that for each line in the file it spawns a telnet session with variables set from the line like spawn telnet from line 1 with each 1 of those words as a variable set to be later used in commands.
This is what I tried so far
foreach ip $ips telnetname $telnetnames slot1 $slots1 slot2 $slots2 { commands here }