New to Samba, so excuse me if this is a stupid question, but I've searched the different on line resources and can't find an answer. When I copy Perl scripts from my Windows 2000 machine to the UNIX Samba share on that same machine, a CR/LF appears at the end of each line instead of just the CR, making UNIX unhappy when I go to run those scripts. Any way to have Samba strip the LF from the end of each line? Thanks in advance, -Brent -- Brent Ayers, CallConnect, Inc. Voice: 303.545.3762 Fax: 303.447.0911 Email: ayers@callconnect.com Text Page: ayers_pager@callconnect.com Mobile: 303.909.0927 eFax: 603.452.2788
On Tue, 19 Feb 2002, Brent Ayers wrote:> When I copy Perl scripts from my Windows 2000 machine to the UNIX Samba > share on that same machine, a CR/LF appears at the end of each line instead > of just the CR, making UNIX unhappy when I go to run those scripts. > > Any way to have Samba strip the LF from the end of each line?Nope. This is a recurring question, and a known issue of DOS/Windows versus Un*x (*not* an issue with Samba). In fact, there is a .txt file in the docs that were installed with your Samba distro addressing this very issue. There are a mryiad of possible ways to deal with this on the Unix side. You can just make a script to run your Perl files through. - john
Hi: I have two scripts: unix2dos and dos2unix, and they makes the work. Thats scripts are part of the Flagship compiler: http://www.fship.com Regards El Mar 19 Feb 2002 17:04, escribi?:> New to Samba, so excuse me if this is a stupid question, but I've searched > the different on line resources and can't find an answer. > > When I copy Perl scripts from my Windows 2000 machine to the UNIX Samba > share on that same machine, a CR/LF appears at the end of each line instead > of just the CR, making UNIX unhappy when I go to run those scripts. > > Any way to have Samba strip the LF from the end of each line? > > > Thanks in advance, > > -Brent-- Gustavo Courault e-mail: courault@gigared.com http://network-online.com.ar ICQ: 15828353
You need a package called dos2unix. SB -----Original Message----- From: samba-admin@lists.samba.org [mailto:samba-admin@lists.samba.org]On Behalf Of Brent Ayers Sent: Tuesday, February 19, 2002 2:05 PM To: samba@samba.org Subject: [Samba] CR instead of CR/LF New to Samba, so excuse me if this is a stupid question, but I've searched the different on line resources and can't find an answer. When I copy Perl scripts from my Windows 2000 machine to the UNIX Samba share on that same machine, a CR/LF appears at the end of each line instead of just the CR, making UNIX unhappy when I go to run those scripts. Any way to have Samba strip the LF from the end of each line? Thanks in advance, -Brent -- Brent Ayers, CallConnect, Inc. Voice: 303.545.3762 Fax: 303.447.0911 Email: ayers@callconnect.com Text Page: ayers_pager@callconnect.com Mobile: 303.909.0927 eFax: 603.452.2788 -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
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