#!/bin/bash
while read var # read variable in specified file (0 or 1)
do
if [ "$var" -eq "0" ] ; then # if variable is 0 throw error message
echo "error"
fi
echo "What is your name?";
read name </dev/tty;
echo "You entered: $name"; sleep 2;
done </path_to_file/file # specified path to file
exit # end of script, exit