I have the following code in bash
read -p "Enter your ID: " ID
unset PASSWORD
prompt="Enter Password:"
while IFS= read -p "$prompt" -r -s -n 1 char
do
if [[ $char == $'\0' ]]
then
break
fi
prompt='*'
PASSWORD+="$char"
done
Practically this code ask to user for a password, and each word type down in terminal shows as * but i have the problem that when I need to delete a character this code it does not takes the backspace, instead shows the backspace as any other character, so I would like to this code does not takes the backspace as character and it erased the words type down in terminal.