Horje
password with asterisk in bash script Code Example
password with asterisk in bash script
#!/bin/bash

password=""
echo "Enter Username : "

# it will read username
read username
pass_var="Enter Password :"

# this will take password letter by letter
while IFS= read -p "$pass_var" -r -s -n 1 letter
do
    # if you press enter then the condition 
    # is true and it exit the loop
    if [[ $letter == $'\0' ]]
    then
        break
    fi
    
    # the letter will store in password variable
    password=password+"$letter"
    
    # in place of password the asterisk (*) 
    # will printed
    pass_var="*"
done
echo
echo "Your password is read with asterisk (*)."




Shell

Related
uninstall webpack globaly Code Example uninstall webpack globaly Code Example
QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket Code Example QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket Code Example
run command from history ubuntu Code Example run command from history ubuntu Code Example
forward parameters batch script Code Example forward parameters batch script Code Example
smb commands Code Example smb commands Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7