Hi again! The problem got solved. It was because i mailed the script as attachement but through an exchange-server. at the server the end of line tags changed from \n to \n\r .. now i will never mail text-files with an exchange-server, except zipped or something else. thanks to all, martin