I'm not sure what I'm missing here. I've got the following read loop in my program:
while true
do
read -p "Would you like to enter an end date (y/n) (if no, end date will default to today) " answer
case $answer in
[yY]* ) while true
do
read -p "Please enter an end date in yyyymmdd format: " answer
echo Running script from dates $startDate to $answer
ruby $DIR/dinersDataAutomation.rb -s $startDate -e $answer
break
done
break
[nN]* ) echo Running script with a start date of $startDate
ruby $DIR/dinersDataAutomation.rb -s $startDate
break
* ) echo "Please enter Y or N"
esac
done
This produces the following error:
./getDinersInfo.sh: line 56: syntax error near unexpected token `)'
./getDinersInfo.sh: line 56: ` [nN]* ) echo Running script with a start date of $startDate'
For the life of me I can't figure out what the error could be. $startDate gets defined in a previous read loop, so I know it's not the fact that $startDate isn't defined.
I'd appreciate a second set of eyes to let me know what I'm missing on these lines.