Plain text file transfer problem

Mark Shaw Mark_Shaw at
Wed Nov 22 21:37:44 GMT 2000

Thank you very much Bill!

That script looks like it'll do the trick!

Best Regards,

"William R. Knox" <wknox at> on 2000/11/22 04:53:44 AM

To:   Mark Shaw/ISM-BC at ISM-BC
cc:   samba at
Subject:  Re: Plain text file transfer problem

It is NOT samba that is doing this - samba does not change the file as
it is transferred (which ftp in ascii mode does), which is at the root
of your problem (perhaps a poor way to state this, really, as this is
desirable behavior). Windows, Macs, and Unix all have different ideas of
how the end of a line should be indicated in a text file. The carriage
returns you see are the result of this inconsistency. The program
dos2unix (a standard part of the install on Solaris and I believe Linux
as well) can be run to remove them ("dos2unix filename filename" will
convert the file to unix format and rewrite it back to the same
filename), or you can use a simple sed script as well.

Good luck.

               Bill Knox
               Senior Operating Systems Programmer/Analyst
               The MITRE Corporation

Mark Shaw wrote:
> Hi all,
> I have a problem with Samba's formatting of plain text files transferred from
> NT 4 machine.  Linux inserts a ^M (carriage return) into every file at the end
> of every line.  Is there a way to configure Samba so it doesn't do this?  I'd
> hate to FTP to my Samba share; it kind of defeats the purpose.  If anyone has
> any ideas I would be most appreciative.
> Thanks in advance
> Mark Shaw

More information about the samba mailing list