How to Use:-
If you want to take input of password in shell script. You must want to not to show any character on-screen entered by user. Use -s for silent mode. Using -s input characters are not echoed. For example create a shell script named inputpwd.sh and add following content.
#!/bin/bash read -s -p "Enter Password: " pswd echo -e "nYour password is: " $pswd
Let’s execute script and enter your password, You just enter your password, characters will not display on-screen.
sh inputpwd.shEnter Password: Your password is: mysecretpassword