Need help with read command

Is there a way to make the input of the read command (or some similar command that I'm unaware of) not visible, or with an astrix??

An example:

#!/bin/bash

 # Example


echo; echo "Who are you??"; read name

if [ "$name" == "John" ];
then echo "Welcome, the terminal is yours."; exit
else "Stranger danger!!"; exit
fi

Where the read input is, instead of seeing "John" being typed, it is blank, or with some non-alphabetical filler.
I'm just curious is this is possible.

Maybe something like this would do what you want?

#!/bin/bash
settings="$(stty -g)"
stty -echo
printf '\nWho are you?: '
read name
stty $settings
echo

if [ "$name" = "John" ]
then	echo "Welcome, the terminal is yours."
else	echo "Stranger danger!!" >&2
	exit 1
fi

As you are using bash , did you consider the buitltin read 's -s option:? man bash :