It's part of a bigger script, and as I said I am not an expert, I am just implementing something to that. However, I just tried what you said and it works finally! I completely ignored the existence of that flag, and it was the key, I think because the file has at the end an empty line. Isn't so?
About quotes I wasn't able to traduce "quoted" in my language (in italian it becomes an unusual word, and google translate doesn't help), that's why I didn't understand, or you know it or you don't know it. But anyway it needed that flag too.
Thanks again! I think I will come back here to ask you something else