[Samba] CR instead of CR/LF

Chris Watt cnww at chebucto.ns.ca
Wed Feb 20 09:22:06 GMT 2002


At 01:04 PM 2/19/02 -0700, Brent Ayers wrote:
>
>Any way to have Samba strip the LF from the end of each line?
>

A number of people have mentioned dos2unix, which is a good script for
line-ending conversion. However, this has to be run from a command line. If
you really want Samba to do it automatically then you need to get a little
more complex. I'd start by creating a share specifically for holding these
scripts (to avoid mangling other files).

You can achieve a slightly more automated solution by using the magic
script option, e.g.:

[perlscripts]
...
magic script = lineconv.sh
...

And then every time you copied over some perl scripts you could copy the
lineconv.sh script over as well and it could run dos2unix on all the files
in the CWD, but this is still not elegant.

I don't know of any way to make Samba automatically run program_x on a file
every time the file is modified (pity that), but you can achieve a similar
effect with a cronjob running every few minutes, or a script that just
watches the modification time of your perl scripts (see the man page for
"find" particularly the "newer" option if unsure of how to design such a
script). 
For my own personal use I eventually concluded that the most elegant
solution is to use a text editor (e.g. GWD Text Editor) which supports UNIX
style line endings.


--

"There are two major products that come out of Berkeley: LSD and UNIX. We
don't believe this to be a coincidence." -- Jeremy Anderson




More information about the samba mailing list