Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

send tcl expect
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 >>>>>>>>>>>>>>"

Report this thread to moderator Post Follow-up to this message
Old Post
401anil@gmail.com
03-31-08 01:41 PM


Re: send tcl expect
On 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


Report this thread to moderator Post Follow-up to this message
Old Post
smallpond
03-31-08 01:41 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:13 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.