# Telnet client

**URL:** <https://www.ruby-forum.com/t/telnet-client/147989>\
**Category:** Ruby\
**Created:** [September 8, 2008, 4:32am UTC](https://www.ruby-forum.com/t/telnet-client/147989 "2008-09-08T04:32:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [September 8, 2008, 4:32am UTC](https://www.ruby-forum.com/t/telnet-client/147989/1 "2008-09-08T04:32:22Z")

</div>

I use ruby wrote a Telnet client application. It works fine until users  
want to change a user name or telnet to other host. I found all these  
failed operations are related with “su -” command or login. How can I  
let ruby deal with these? Below is my core code for this telnet client:

while 1 == 1  
c=gets  
tn.cmd©{|c| print c}  
if c==“exit”  
break  
end  
end

It simply get what user input and put it on the telnet server.

---

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [September 9, 2008, 4:54am UTC](https://www.ruby-forum.com/t/telnet-client/147989/2 "2008-09-09T04:54:32Z")

</div>

Zhao Yi wrote:

> I use ruby wrote a Telnet client application. It works fine until users  
> want to change a user name or telnet to other host. I found all these  
> failed operations are related with “su -” command or login. How can I  
> let ruby deal with these? Below is my core code for this telnet client:
> 
> while 1 == 1  
> c=gets  
> tn.cmd©{|c| print c}  
> if c==“exit”  
> break  
> end  
> end
> 
> It simply get what user input and put it on the telnet server.

Can anybody help me on this? Is there a problem with “gets”? I changed  
it to “STDIN.gets” but still have such problem.

---

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [September 9, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/telnet-client/147989/3 "2008-09-09T14:59:49Z")

</div>

> Can anybody help me on this? Is there a problem with “gets”? I changed  
> it to “STDIN.gets” but still have such problem.

I replied on the mailing list:  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314220](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314220)  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314221](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314221)

However there appears to be a problem with the gateway to ruby-forum.

---

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [September 9, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/telnet-client/147989/4 "2008-09-09T16:17:41Z")

</div>

On Sep 9, 2008, at 7:53 AM, Brian C. wrote:

> > Can anybody help me on this? Is there a problem with “gets”? I  
> > changed  
> > it to “STDIN.gets” but still have such problem.
> 
> I replied on the mailing list:  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314220](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314220)  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314221](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/314221)
> 
> However there appears to be a problem with the gateway to ruby-forum.

It does appear that they reached Usenet OK though:

[http://groups.google.com/group/comp.lang.ruby/msg/d716ac4f7e2a9851](http://groups.google.com/group/comp.lang.ruby/msg/d716ac4f7e2a9851)  
[http://groups.google.com/group/comp.lang.ruby/msg/a1bc46ad94a2bf7a](http://groups.google.com/group/comp.lang.ruby/msg/a1bc46ad94a2bf7a)

Hopefully that means that I fixed the other gateway. 🙂

James Edward G. II
