Syntax error near unexpected token `done'

Thanks for helping ! (I'm not joking, anbu )
This is just a small test script ... and yes, I do have backup :slight_smile:

sed -n l sql.sh

I think that previous posts are going to show that this was a text file created on a Microsoft platform and copied to a unix server without converting the MSDOS line terminators from carriage-return/linefeed to the unix text file line terminator linefeed.
It is the one of the oldest errors in MSDOS which has continued into Windows.

This was not good:

See the man page for "dos2unix" or "dos2ux" depending on your O/S. However the usual cause of this problem is using binary mode ftp not text mode ftp.