Telnet issue

M

Marcin Tyman

hi guys,
I've got issue with following:
#########################################################
begin

t.cmd('String' => "echo -e '#{buffer}' > #{data['cfgwlan']}.tmp",
'Timeout' => 10, 'Match' => "#{data['match']}")

rescue TimeoutError, Timeout::Error => e
myLogger.error("#{__FILE__} #{__LINE__} Exception:
#{e.backtrace.join()}")
end #begin
#########################################################
buffer - is a string
data['cfgwlan'] - is file path with file_name
t - is telnet object and works correctly with other commands.

But in this case t.cmd causes Timeout::Error exception all the time but
data['cfgwlan'] is each time is overwritten correctly. Looks like that
after
echo -e '#{buffer}' > #{data['cfgwlan']}.tmp none of prompt has been
appearing and the command ends on timeout.

What is wrong with it?

Any help would be helpful.
Thanks in advance.
MT
 
R

Robert Dober

Well I can reproduce your problem, but as I have no idea what is in
buffer it is difficult to tell what really is your problem.

buffer="$( sleep 20 )"

are things in buffer complex enough to cause that kind of problem?
You really need to tell us what is in buffer when it blocks I am afraid.

Cheers
Robert
 
M

Marcin Tyman

Robert said:
Well I can reproduce your problem, but as I have no idea what is in
buffer it is difficult to tell what really is your problem.

buffer="$( sleep 20 )"

are things in buffer complex enough to cause that kind of problem?
You really need to tell us what is in buffer when it blocks I am afraid.

Cheers
Robert

My stupid fault. In place of "#{data['match']}"... should be Regexp
object not string. This is why it didn't work. Now it is ok.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top