Hello I'm using read in bash to ask for a password and have -s to hide input and -t 10 to timeout and all works as expected except for one thing.
Here is the code (I'm using the array switch):
read -t 10 -a mp -s -p "Enter Password:"
It hides the input and if I don't type anything it returns to prompt in 10 secs.
But if I type first 10 chars of a 12 char pass and it times out well when it returns it shows the chars I typed on the next line.
Example:
DD-WRT-Bash:~# read -t 10 -a mp -s -p "Enter Password:"
(i type testing123)
If I don't hit enter and it times out next line is:
DD-WRT-Bash:~# testing123
It does the same thing in Ubuntu.
Is there anyway to prevent the text from being returned on the next line?