Below is a perl script which I used to modify for all networking devices.
You just need to have similar commands in TCL and it will work
use Net::Telnet;$telnet = new Net::Telnet ( Timeout=>10,Errmode=>'die');
$telnet->open('10.209.70.x');
$telnet->login('admin', 'admin');
print $telnet->cmd('configure');
print $telnet->cmd('run show version');
sleep 1;
print $telnet->cmd('run show interfaces ge-0/0/0 brief | grep Physical ');
sleep 1;
print $telnet->cmd('exit');
print $telnet->cmd('set cli screen-length 0'); ------------Instead say disable clipaging
print $telnet->cmd('configure');
print $telnet->cmd(' run show log messages | grep ge-0/0/0 | last 10 ');#this works now
sleep 10;
$counter = 0;
while ($counter < 3)
{
chomp ();
open (FILE, ">gilly.txt");
print FILE (print $telnet->cmd(' run show spanning-tree interface '));
sleep .5;
close (FILE);
$counter = $counter + 1;
}