views:

123

answers:

1

I want to read in a password as part of a command-line script, but do not what the typed password to appear on the screen. This seems to be a fairly common feature in command-line apps, but my Google-fu has failed in identifying how this works. Is it a feature of the OS? Do you have to intercept the input stream somehow so it doesn't write out to the console? I would like to use this in a php command line script, but I cannot use what I cannot understand.

Some independent searching yielded this link, where way down at the bottom they mention that mysqladmin does not use STDIN to read in the password. How do they do it then, and how could I implement this functionality?

+2  A: 

See here and here Cheer! :-D

NawaMan