From: Paul Brannan Date: 2003-01-09T23:26:15+09:00 Subject: Re: prompt On Thu, Jan 09, 2003 at 11:56:00AM +0900, TOTO wrote: > gets doesn't work. I tried it at the beginning. I think the problem is > that it Reads the *next* ``line'' from the I/O stream. (So it can't > read the string following the question mark.) gets() should work, but you should use $stdin.gets() instead: bash$ ruby -v ruby 1.6.8 (2002-12-24) [i686-linux] bash$ ruby -e 'print "input: "; $stdout.flush; p gets' input: testing "testing\n" bash$ ruby -e 'print "input: "; $stdout.flush; p gets' foo input: -e:1:in `gets': No such file or directory - "foo" (Errno::ENOENT) from -e:1 bash$ ruby -e 'print "input: "; $stdout.flush; p $stdin.gets' foo input: testing "testing\n"