Here is an simple bash script which reads the password value from a user and does not show the same on the screen.
Feel free to modify and use this script.
Feel free to modify and use this script.
Source:
$ cat readpass.sh
#!/bin/bash
echo -n "Enter your username: ";
read username
echo -n "Enter your passwd: "
read -s passwd
echo
echo "$username, your passwd is $passwd";
Output:
$ ./readpass.sh
Enter your username: nikesh
Enter your passwd:
nikesh, your passwd is linuxpoison
$ cat readpass.sh
#!/bin/bash
echo -n "Enter your username: ";
read username
echo -n "Enter your passwd: "
read -s passwd
echo
echo "$username, your passwd is $passwd";
Output:
$ ./readpass.sh
Enter your username: nikesh
Enter your passwd:
nikesh, your passwd is linuxpoison
2 comments:
Dude, you should probably change that now. :)
Enjoying the Bash tricks a lot, thanks!
ha ha :)
Post a Comment