Configure SAMBA to avoid ^M-problem

Shaun Lipscombe shaun.lipscombe at gasops.co.uk
Tue Mar 6 11:18:25 GMT 2001


* "Jan" == Jan M Skarberg (ETO) <Jan.M.Skarberg at eto.ericsson.se> writes:

 > Hi, How can I configure SAMBA so I can avoid ^M-characters?

You should only get ^M (Chr+Lf) when viewing a text file saved from a
windows machine on the samba unix box.  This is because UNIX uses nl
as line seperators and DOS text file format is to use Chr+Lf.  If you
view the file in question in vi you should see [DOS FORMAT] written at
the bottom.  When you use a text editor on the unix box you are not
using Samba to access the file so you cannot configure Samba to do the
DOS->UNIX conversion.  

If you are getting ^M when viewing a file from a windows machine then
ignore everything I have just said and I have no idea what the problem
is :(


Solution:
One way around the problem is to create the text file on the unix box
and then use Wordpad to view the file on Windows as it will view it
correctly.  Alternatively you can use a variety of unix utils to
convert the file (even in vi, you could do something like :%s/^V^M//g)
like tr, sed, perl, awk to unix format.  Failing that ftp the file
from the unix box to a windows box and it will do the translation for
you but this is a lazy way of doing things!

Hope that helps,

Shaun

-- 
          (o_
(o_  (o_  //\
(/)_ (/)_ V_/_   shaun.lipscombe at gasops.co.uk





More information about the samba-ntdom mailing list