From: Bertram Scharpf Date: 2009-09-25T04:08:29+09:00 Subject: Re: Force enter in gets Hi, Am Freitag, 25. Sep 2009, 01:35:46 +0900 schrieb Jack Bauer: > Let's say I have a ruby script that gets some user input: > > name = gets > > How can I make it so after 10 seconds of no input (or even if they start > typing, it'll cut them off after 10 seconds) it will continue? In other > words, essentially simulate the return key after 10 seconds. name = if select [$stdin], nil, nil, 10 then gets else "Joe" end Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de