I learn BASH scripting occasionally from time to time, now I am working on a simple bash script that serves to maintain Dovecot user database. The general purpose of the script is able to list, add or delete user entries in the specified file. Please add some comments about the code - common mistake and etc. I want to learn more about code simplicity and avoiding bad habits.#!/bin/bashUSERDB=/etc/dovecot/usersMAILBOXMAP=/etc/postfix/virtual/virtual-mailbox-maps.cf## Add user functionadd_user () {# Reading usernamewhile [[ -z $USERNAME ]]; do    echo -n Please enter username:     read USERNAMEdone# Reading domain namewhile [[ -z $DOMAIN ]]; do    echo -n Please enter domain name:     read DOMAINdone# Reading password and generating hash with doveadm pwwhile [[ -z $PASSWORD ]]; do    echo -n Please enter user password:     read PASSWORDdoneif [[ -n $PASSWORD ]]; then    USERPASS=$(doveadm pw -p $PASSWORD -s SHA512-CRYPT)fi# Adding provided credentials to Dovecot userdbecho Adding user credentials to userdb...echo $USERNAME@$DOMAIN:$USERPASS::: >> $USERDB# Adding provided user@domain to postfix mailbox mapecho Adding user credentials to postfix map...echo $USERNAME@$DOMAIN $DOMAIN/$USERNAME >> $MAILBOXMAP# Hashing the mapif [[ -f $MAILBOXMAP ]]; then     postmap hash://$MAILBOXMAP     echo Hashing map is done!else     echo Postfix map not exist or have been moved to another directory!     exit 1fiexit 0}## List all users functionlist_users () {if [[ -f $USERDB ]]; then    awk -F: '/./'' {print $1} ' $USERDBelse    echo User database not exist or have been moved to another directory!    exit 1fi}## Delete user functiondelete_user () {if [[ -n $DELUSER ]]; then    sed -i /^$DELUSER$/d $USERDB $MAILBOXMAP && echo User account have been  deleted!else    echo User not found!    exit 1fi}case $1 in add|-a)    add_user    ;; list|-l)    list_users    ;; delete|-d)    shift    deluser=$1    delete_user    ;; *)    echo Unknown command    ;;esac
Maintaining users in a Dovecut user database
bash;linux;email