Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3151

Re: Telnet "More?"

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!talisker.lacave.net!lacave.net!not-for-mail
From Brian Candler <b.candler@pobox.com>
Newsgroups comp.lang.ruby
Subject Re: Telnet "More?"
Date Tue, 19 Apr 2011 04:18:00 -0500
Organization Service de news de lacave.net
Lines 34
Message-ID <c90962a3c57ccedb81a073a7013f756c@ruby-forum.com> (permalink)
References <0bc1be8ec871e5fbad7753c695247ddc@ruby-forum.com>
NNTP-Posting-Host bristol.highgroove.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace talisker.lacave.net 1303204709 92012 65.111.164.187 (19 Apr 2011 09:18:29 GMT)
X-Complaints-To abuse@lacave.net
NNTP-Posting-Date Tue, 19 Apr 2011 09:18:29 +0000 (UTC)
In-Reply-To <0bc1be8ec871e5fbad7753c695247ddc@ruby-forum.com>
X-Received-From This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count 381831
X-Ml-Name ruby-talk
X-Rubymirror Yes
X-Ruby-Talk <c90962a3c57ccedb81a073a7013f756c@ruby-forum.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:3151

Show key headers only | View raw


Eric T. wrote in post #993311:
>    t.cmd('dir', &out)
>    t.cmd('dir', &out)

t.cmd is really shorthand for t.puts followed by t.waitfor

So you could try something like this:

def cmd_or_more(str, &blk)
  t.puts str
  loop do
    res = t.waitfor(/:.*>|More\?/, &blk)
    break if res =~ /:.*>/
    t.puts ""
  end
end

t.cmd_or_more('dir', &out)
t.cmd_or_more('dir', &out)

Of course, if the question is really "why does Microsoft hang with a 
'More?' prompt when dir is issued a second time", then this isn't really 
the right solution.

It would be better if you could issue some command to the CLI to say "no 
pager" - like "term len 0" on a Cisco router.

Regards,

Brian.

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Telnet "More?" "Eric T." <erictetz@gmail.com> - 2011-04-17 02:10 -0500
  Re: Telnet "More?" Christopher Dicely <cmdicely@gmail.com> - 2011-04-17 09:56 -0500
    Re: Telnet "More?" "Eric T." <erictetz@gmail.com> - 2011-04-17 20:00 -0500
  Re: Telnet "More?" 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-17 17:47 -0500
    Re: Telnet "More?" "Eric T." <erictetz@gmail.com> - 2011-04-17 19:48 -0500
      Re: Telnet "More?" Christopher Dicely <cmdicely@gmail.com> - 2011-04-18 00:37 -0500
      Re: Telnet "More?" 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-19 12:21 -0500
  Re: Telnet "More?" "mouser" <invalid@invalid.com> - 2011-04-18 04:18 +0000
    Re: Telnet "More?" "mouser" <invalid@invalid.com> - 2011-04-18 04:22 +0000
  Re: Telnet "More?" Brian Candler <b.candler@pobox.com> - 2011-04-19 04:18 -0500
    Re: Telnet "More?" "mouser" <invalid@invalid.com> - 2011-04-19 16:36 +0000
      Re: Telnet "More?" Markus Fischer <markus@fischer.name> - 2011-04-19 12:12 -0500

csiph-web