Surround code with [code]..[/code] blocks to post code, so formatting is not lost.
There are three syntax errors in the code presented - lack of whitespace after bracket in the first "if", lack of "fi" for the same, and lack of "done" for the loop. (The latter two would suggest you neglected to copy the whole thing, except the error says otherwise; did you write this code from scratch or copy it from somewhere?)
As per the
Bash manual read without a variable name specified will default to setting
REPLY. If you want to change that you must specify the name.
ShellCheck is a tool that can be used both online or offline to highlight all these (and a couple of other issues).