With a bash script, I tried to process a file that contains one e-mailaddress per line. I wanted to create a new file with an SQL command per e-mailaddress, something like
UPDATE tt_address SET deleted=1 where email='$EMAIL';
Executing it manually on the command line works as expected. If I set the variable EMAIL and echo the update code in quotation marks, it returns the correct SQL code.
If I do the same with in a bash script with the input file, it returns
';DATE tt_address SET deleted=1 where email@example.com
The issue was the encoding of the input data file. The command dos2unix replaces windows line breaks by linux ones.