Hello, <br><br>I&#39;m creating an expect script to:<br><br>telnet router<br>execute command<br>exit<br><br>This seems to be quite easy when you have 1 router, the problem is I have a list of 40 routers, so I thought about creating a expect script but I have gotten some problems.<br>
The first one is...how to include all the machines?<br>I thought about something like: for d in $(cat router_list); do expect_script $d;done<br><br>And if that worked, the script would take $d and do:<br><br>telnet $d<br>
execute my command<br>exit<br><br>But I don&#39;t know how to accomplish that as the script and the &quot;expect --exact&quot; output are different, one per router, basically because:<br>expect -exact &quot;telnet router23\r<br>
Trying 192.168.33.12...\r<br>Connected to router23.test.\r<br><br>Changes in all the routers, I have tried to delete that whole paragraph so it only expects &quot;Login&quot;, but it doesn&#39;t work.<br><br>And also...how to include the script in the &quot;for&quot; loop?.<br>
<br>Any idea will be appreciated.<br><br>Arthur.<br><br><br><br>