The benefit of being old and grey in IT.
Before those fancy fonts, computer output was done on printers and screens with constant width (equally spaced) character positions. One character was one byte.
A screen had 24 lines and 80 columns. A large printer had 66 lines (11 inch paper) of 132 characters. A punched card had 80 characters.
Set your text in font "Courier" and you will see, that you can count the lines and columns.
Error detected at (row,column) means that's the point that the code parser found something wrong, It could be too late. An unclosed ( or " could make some code still be parsed the wrong way, and only later an inconsistency is found. The hint is not always the real problem , like "expected end of command" means it cannot process the extra information on that line. The root cause can be somewhere earlier in the script.
One way of testing is taking logical blocks of code out of the script by copy, and paste it in the CLI session.as if you just typed it in (and indeed Putty does that very well)