Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

24 Jul 2005

Read from STDIN without echoing the input back

Today i was looking for a way to read passwords from a PHP-CLI script. So it was important the password didn’t appear on the console. I wrote a ttyecho function that uses stty to change the terminal line settings.