Logan Capaldo wrote: >On Tue, 22 Mar 2005 04:24:53 +0900, vladimir konrad <bouncer / nowhere.org> wrote: > > >>Hello, >> >>How to disable output when reading with readline on linux? The script needs >>to read a password and I would like it not to display... >> >>Any ideas? >> >>Vladimir >> >> >> >> > >I would imagine it would require 'curses'. A "simpler" method might be >figuring out what $TERM is and getting the proper escape sequences to >make the foreground the same color as the background. Off course, >that's kind of the point of curses...and if your script ends up on >some really weird terminal somewhere it might mess it up. > > > > You need the modules ruby-termios and ruby-password. Both of these are available from RAA http://raa.ruby-lang.org/project/ruby-password/ http://raa.ruby-lang.org/project/ruby-termios/ You may run into problems with buffered/unbuffered inputs if any exceptions happen (ie prntscrn, ctrl+c etc.) but termios is used to mask the user input. -Chris