I am new to ruby. I need to receive password as an input through gets
command.
How do I hide the password input typed in the terminal, during gets
For ruby version 1.8 (or Ruby < 1.9) I used read shell builtin as mentioned by @Charles.
Putting the code thats just enough to prompt for user name & password, where user name will be echoed to screen while typing in however password typed in would be silent.
userid = `read -p "User Name: " uid; echo $uid`.chomp
passwd = `read -s -p "Password: " password; echo $password`.chomp