



Can TCL allowing spawning 2 telnet sessions to different switches then allow issuing command to each switch?
Below is the sample code:
spawn telnet $switch1_ipAddr
set spawn_switch1 $spawn_id
spawn telnet $switch2_ipAddr
set spawn_switch2 $spawn_id
set commandToSend "ls"
send -i $spawn_switch1 "$commandToSend\r"
send -i $spawn_switch2 "$commandToSend\r"
Yes, you can have numerous telnet sessions running simultaneous. It is then important to keep track of the spawn_id and manage input from the in the 'expect' statement.
What all can be the reasons for spawn telnet failure on a particular machine, while telnet is possible on that machine.
You want to use the BSD telnet, as the Microsoft one has proved more problematic to control.