Error:

Read variable from user

read -p "Enter year: " year
echo "You entered: $year"

Read array from user

read -p "Enter year/month/day: " data
# enter "1980 12 01"
echo "You entered: year=${data[0]}, moth=${data[1]} day=${data[2]}"
# Result is "You entered: year=1980, moth=12 day=01"

Prompt user for confirmation

read -p "Are you sure? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    echo "Let's get dangerous"
fi

Check if shell is interactive

case $- in
*i*)   echo "Interactive"     ;;
  *)   echo "Not interactive" ;;
esac