Variable
NAME="John"
echo $NAME
echo "$NAME"
echo "${NAME}
This shows the common ways to read a Bash variable. Quoting is usually the safe default because it keeps spaces and special characters from breaking your output.
Condition
if [[ -z "$string" ]]; then
echo "String is empty"
elif [[ -n "$string" ]]; then
echo "String is not empty"
fi
This is the standard Bash string check. -z means the value is empty, and -n means it has content.