#!/bin/sh
#
#  Date: Thu May 16 11:26:59 EDT 2019
#  Name: pres
#

function display {
  eval "echo $RESPONSE: \$RECORD${RESPONSE}"
}

function talk {
   read -p "Please enter a number (0 to exit): " RESPONSE
   if [[ $RESPONSE -eq 0 ]]
   then
      echo "Goodbye"
	  exit 0
   fi
}

DATA="$HOME/data/pres"
COUNT=1

exec 3< $DATA

while read  LINE <&3
do
  eval RECORD${COUNT}=\'"${LINE}"\'
  (( COUNT = COUNT + 1 ))
done 

exec 3<&-

while true
do
  talk
  display
done

exit 0     
