From: Robert Klemme Date: 2007-03-05T22:55:08+09:00 Subject: Re: mask gets_chomp ? On 05.03.2007 14:15, Rebhan, Gilbert wrote: > Hi, > > i have a script that uses a password as input. > > The password is provided via gets_chomp > in the shell. > > Is there a way to mask the password with * > or do i have to write a gui for that ? Maybe you can do that via curses. Other than that, you could use "stty -echo" before and "stty echo" after the password input: 14:50:07 [~]: ruby -e 'system("stty", "-echo") > puts "enter!" > pass=gets.chomp > puts "You entered #{"*" * pass.size}" > system("stty", "echo")' enter! You entered ****** 14:50:56 [~]: Kind regards robert