need help urgently

need help urgently

am 08.04.2008 14:37:48 von anil_ec1

Hi,

I have written a script in tcl and expect i have to send more than
1024B data to a switch. I can send that with multiple send commands
with one expect but I want to use 1 send command only but i am unable
to send that much. I am using linux machine to run this script. One of
my friend said that it is a limitation of the shell that we r using if
this is correct then tell me how to increse that shell size?
Here I am sending my script please tell me the required
modifications..
#!/usr/bin/tcl
package require Tclx
package require Expect

spawn telnet 192.179.0.5
set command "ping6 fe80::218:feff:fe86:e480%vlan1 data-fill "
set a
"11111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111"
set b
"11111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1111
111111111111111111111111111111"
match_max 100000
expect "Press"
send -- "\r"
expect "*#" {
send -- "$command"
send -- "$a"
send -- "$b"
send -- "\r"
}
expect {
"*#" {
puts "\n its here"
append bufferContents $expect_out(buffer)
puts "contents are : $bufferContents"
}
}

.............................
regards,
Anil A Kumar

Re: need help urgently

am 08.04.2008 18:13:03 von Glenn Jackman

You may want to consider cross-posting, not multi-posting

--
Glenn Jackman
"If there is anything the nonconformist hates worse than a conformist,
it's another nonconformist who doesn't conform to the prevailing
standard of nonconformity." -- Bill Vaughan

Re: need help urgently

am 08.04.2008 19:03:23 von Maxwell Lol

anil_ec1 <401anil@gmail.com> writes:

> I have written a script in tcl and expect i have to send more than
> 1024B data to a switch. I can send that with multiple send commands
> with one expect but I want to use 1 send command only but i am unable
> to send that much. I am using linux machine to run this script. One of
> my friend said that it is a limitation of the shell that we r using if
> this is correct then tell me how to increse that shell size?

Use a different shell. I believe perl has an expect extension.

Or - you can change the source code.....

Re: need help urgently

am 09.04.2008 05:03:25 von anil_ec1

On Apr 8, 10:03 pm, Maxwell Lol wrote:
> anil_ec1 <401a...@gmail.com> writes:
> > I have written a script in tcl and expect i have to send more than
> > 1024B data to a switch. I can send that with multiple send commands
> > with one expect but I want to use 1 send command only but i am unable
> > to send that much. I am using linux machine to run this script. One of
> > my friend said that it is a limitation of the shell that we r using if
> > this is correct then tell me how to increse that shell size?
>
> Use a different shell. I believe perl has an expect extension.
>
> Or - you can change the source code.....

no friend actually we r writing the script according to some standards
already we have a frame work to implement So i need a generic program
thatz y i am asking

Re: need help urgently

am 09.04.2008 17:26:28 von Maxwell Lol

anil_ec1 <401anil@gmail.com> writes:

> On Apr 8, 10:03 pm, Maxwell Lol wrote:
> > anil_ec1 <401a...@gmail.com> writes:
> > > I have written a script in tcl and expect i have to send more than
> > > 1024B data to a switch. I can send that with multiple send commands
> > > with one expect but I want to use 1 send command only but i am unable
> > > to send that much. I am using linux machine to run this script. One of
> > > my friend said that it is a limitation of the shell that we r using if
> > > this is correct then tell me how to increse that shell size?
> >
> > Use a different shell. I believe perl has an expect extension.
> >
> > Or - you can change the source code.....
>
> no friend actually we r writing the script according to some standards
> already we have a frame work to implement So i need a generic program
> thatz y i am asking


I think the problem is the length of the line is too long for the
shell you are using.

So as I said - either (a) fix the broken shell, or (b) use a different shell.

As for (a) - You can't increase the length of the line in the shell without
changing the source code of the shell and recompiling.

So the other answer is to use a different shell.

What's the version of the shell you are using? Which Operating system?
Which revision?