Code Comments
Programming Forum and web based access to our favorite programming groups.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
11111111111111111111111111111111111
1111111111111111111111111111111111111111
11
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111"
set b
" 1111111111111111111111111111111111111111
11111111111111111111111111111111111
1111111111111111111111111111111111111111
11
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
1111111111111111111111111111111111111111
111111111111111111111111111111111111
1111111111111111111111111111111111111111
11111111
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"
}
}
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 >>>>>>>>>>>>>>"
Post Follow-up to this messageOn Mar 31, 7:06 am, 401a...@gmail.com wrote: > 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 There's your problem. Change to: #!/usr/bin/perl
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.