# Telnet and redirection of stream

**URL:** <https://www.ruby-forum.com/t/telnet-and-redirection-of-stream/109946>\
**Category:** Ruby\
**Created:** [July 20, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/telnet-and-redirection-of-stream/109946 "2007-07-20T15:50:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirtyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Post date:** [July 20, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/telnet-and-redirection-of-stream/109946/1 "2007-07-20T15:50:49Z")

</div>

Hi,  
Here is my command:

t.cmd(‘String’ =\> “echo -e ‘#{buffer}’ \> #{data[‘cfgwlan’]}.tmp”,  
‘Timeout’ =\> 10, ‘Match’ =\> “#{data[‘match’]}”)

Where:  
t - telnet object (used several times in my code)  
#{buffer} - is string to redirect  
#{data[‘cfgwlan’]}.tmp - file path/name  
#{data[‘match’]} - prompt (is ok because I use it several more times in  
my code)

The problem is that the command always ends on timeout. What is wrong  
with it. Any other command executed exactly with the same way ends ok  
with matching prompt.

Any help will be helpful.  
Thanks
