Josef Wolf wrote: > On Sat, Sep 16, 2006 at 01:58:27AM +0900, Kent Sibilev wrote: >> On 9/15/06, Josef Wolf <jw / raven.inka.de> wrote: >>> I'm looking for a readline() with history and editing support (like perl's >>> Term::Readline). Does such a thing exist for ruby? Here's a simple example that shows line editing and history (completion is a little more complicated, but I can give you an example): #!/usr/bin/env ruby require "readline" class Shell include Readline def initialize puts puts 'type "Q" or ^D to quit.' puts while true do line = readline("> ", true) if not line puts break end if /q/i === line break end puts "You typed #{line.inspect}" end end end if __FILE__ == $0 Shell.new end -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407