shell read -p -s hanging, need to press enter key twice to make it run
Hi, when i try to input the password with read -s -p "": variable
then it's hanging, it needs me to press the enter key twice, don't know why, anyone can help? thanks |
Take a note that, option -s is used for supress or silent, and -p is for prompt, so use only -s.
If you want to hide the password, just do it like, Code:
echo -n "Enter password: " |
Quote:
|
Seems to work just fine for GNU bash, version 4.2.39(1)-release
|
Thanks for all your information, today i found the reason by accident. i put a if sentence and some other command after read, then after i input password, it didn't give reply at all, like it's still waiting me to input the password, but the fact is it's already running, then i add an echo "Program is running, please wait for a while...", then after I input the password, Program is running, please wait for a while... shows immediately, then i figured out this is the reason. thanks again.
|
Please mark as SOLVED once you have a solution.
|
All times are GMT -5. The time now is 08:41 PM. |