Perl password input
I am taking arguments from stdin, an LDAP username and password. How can I get the input for the password to not display on the console. Example, when you su and are prompted for the password, it doesn't display it as you type. Is there a way to do this? I haven't found anything yet.
Cheers |
You need to switch the terminal to raw mode and disable the echoing of characters. The only way I know of to do this (in PERL) is with the curses library.
|
|
Solution
I have figured this out. It is fairly easy, I just didn't know what I was looking for.
use Term::ReadKey; ReadMode 2; Get STDIN; ReadMode 0; |
IO::Prompt is a better way to do this.
The above method will eliminate all echoing |
All times are GMT -5. The time now is 03:59 PM. |