| 401anil@gmail.com 2008-03-31, 6:19 am |
| Hi,
I have written a script in tcl n expect to send a command to a switch
with tenet.
but i am unable to send more than 1024B data using send command i am
executing this script in linux machine please i need ur help here is
the script ........
#!usr/bin/tcl
package require Tclx
package require Expect
spawn telnet 192.179.0.5
match_max 5000
set bufferContents ""
set full ""
set match ""
set timeout 30
set c "ping6 fe80::207:e9ff:fe09:fb6d%vlan1 "
set a
" 1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111"
set b
" 1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111111111111111111111111111111111111111
1111
111111111111111111"
expect {
-nocase -re {Press*} {
send "\r"
exp_continue
}
{#} {
send "ping6 fe80::207:e9ff:fe09:fb6d%vlan1 data-fill $b\r"
}
timeout { puts "FAIL" }
}
expect {
"*#" {
puts "\n its here"
append bufferContents $expect_out(buffer)
puts "contents are : $bufferContents"
}
"Request*" {
puts "Invalid length"
}
timeout {
puts " error : 32"
}
}
send "\r"
expect "#"
if { [regexp " is alive," $bufferContents full] } {
puts "match is : $full"
} elseif { [regexp "Invalid length." $bufferContents full] } {
puts "invalid"
}
set len [string length $b]
puts "\n <<<<<<<<<<<<<<<<<< length is : $len >>>>>>>>>>>>>>"
|