I have been reviewing Louis' script (4-setup-sernet-samba4-MEMBER-wheezy.sh) and within the following line (310) is an odd character combination. if [ ${SMBPRINTING} = no ]; then echo "==========Disable Printing ===============================" sed -i '49a\n # disable printing completelyn load printers = non printing = bsdn printcap name = /dev/nulln disable spoolss = yesn'^M <<<<<<< WHAT? /etc/samba/smb.conf fi I am using vi editor (Debian 7.7.0) and noticed "^M" at the end of the line. This character combination appears twice within the script. Both time as a unique font color. Here listed above and finally on the last line of the script. In 'test' removing the character combination the cursor responds as though this is a single character. In other words, a single keystroke removes both characters. Is this a necessary character for the script to function properly? Or is it rogue and causing some unforeseen issues? (I feel bad raising this question while Louis is on a holiday. Many of us have been using his script for some time now and history indicates that they are working scripts. And I for one really appreciate all the work that went into them.) -- ------------------------- Bob Wooden of Donelson Trophy 615.885.2846 (main) www.donelsontrophy.com [1] "Everyone deserves an award!!" Links: ------ [1] http://www.donelsontrophy.com
On 15-01-10 06:43 AM, Bob of Donelson Trophy wrote:> > > I have been reviewing Louis' script > (4-setup-sernet-samba4-MEMBER-wheezy.sh) and within the following line > (310) is an odd character combination. > > if [ ${SMBPRINTING} = no ]; then > echo "==========Disable Printing ===============================" > sed -i '49a\n # disable printing completelyn load printers = non > printing = bsdn printcap name = /dev/nulln disable spoolss = yesn'^M > <<<<<<< WHAT? > /etc/samba/smb.conf > fi > > I am using vi editor (Debian 7.7.0) and noticed "^M" at the end of the > line. This character combination appears twice within the script. Both > time as a unique font color. Here listed above and finally on the last > line of the script. In 'test' removing the character combination the > cursor responds as though this is a single character. In other words, a > single keystroke removes both characters. > > Is this a necessary character for the script to function properly? Or is > it rogue and causing some unforeseen issues? > > (I feel bad raising this question while Louis is on a holiday. Many of > us have been using his script for some time now and history indicates > that they are working scripts. And I for one really appreciate all the > work that went into them.) >IIRC the ^M (as a single character) is an artefact of windows CR/LF (newline) as represented in vi. you can get rid of it with dos2unix (apt-get install dos2unix) using something like dos2unix < newFileName > 4-setup-sernet-samba4-MEMBER-wheezy.sh the vi I am using (vim.basic, added after install) does not show the ^M construct on files that I know have it (probably a setting somewhere) I believe ctrl+m will reproduce the "single character". In my instance of vi, it creates a newline without showing the ^M that I definitely remember seeing in my users (windows) logon scripts. Cheers! d.
On 15-01-10 06:43 AM, Bob of Donelson Trophy wrote:> > > I have been reviewing Louis' script > (4-setup-sernet-samba4-MEMBER-wheezy.sh) and within the following line > (310) is an odd character combination. > > if [ ${SMBPRINTING} = no ]; then > echo "==========Disable Printing ===============================" > sed -i '49a\n # disable printing completelyn load printers = non > printing = bsdn printcap name = /dev/nulln disable spoolss = yesn'^M > <<<<<<< WHAT? > /etc/samba/smb.conf > fi > > I am using vi editor (Debian 7.7.0) and noticed "^M" at the end of the > line. This character combination appears twice within the script. Both > time as a unique font color. Here listed above and finally on the last > line of the script. In 'test' removing the character combination the > cursor responds as though this is a single character. In other words, a > single keystroke removes both characters. > > Is this a necessary character for the script to function properly? Or is > it rogue and causing some unforeseen issues? > > (I feel bad raising this question while Louis is on a holiday. Many of > us have been using his script for some time now and history indicates > that they are working scripts. And I for one really appreciate all the > work that went into them.) >should spend 3 minutes with google before replying.. check this out: http://stackoverflow.com/questions/3852868/how-to-make-vim-show-m-and-substitute-it (my newreader probably wrapped the above line, so you'll have to re-constitute it.) cheers! d.
On 10/01/15 14:43, Bob of Donelson Trophy wrote:> > > I have been reviewing Louis' script > (4-setup-sernet-samba4-MEMBER-wheezy.sh) and within the following line > (310) is an odd character combination. > > if [ ${SMBPRINTING} = no ]; then > echo "==========Disable Printing ===============================" > sed -i '49a\n # disable printing completelyn load printers = non > printing = bsdn printcap name = /dev/nulln disable spoolss = yesn'^M > <<<<<<< WHAT? > /etc/samba/smb.conf > fi > > I am using vi editor (Debian 7.7.0) and noticed "^M" at the end of the > line. This character combination appears twice within the script. Both > time as a unique font color. Here listed above and finally on the last > line of the script. In 'test' removing the character combination the > cursor responds as though this is a single character. In other words, a > single keystroke removes both characters. > > Is this a necessary character for the script to function properly? Or is > it rogue and causing some unforeseen issues? > > (I feel bad raising this question while Louis is on a holiday. Many of > us have been using his script for some time now and history indicates > that they are working scripts. And I for one really appreciate all the > work that went into them.) >Hi Bob, you seem to have more wrong than you think, this is the block of code you are referring to: if [ ${SMBPRINTING} = no ]; then echo "==========Disable Printing ===============================" sed -i '49a\\n # disable printing completely\n load printers = no\n printing = bsd\n printcap name = /dev/null\n disable spoolss = yes\n' /etc/samba/smb.conf fi The 'sed' line should be all one line and all the newlines seem to have been turned into just an 'n', they should be '\n', try looking at the script with gedit or nano. If you are interested, I now have a script to install a member server using samba packages from debian backports instead of using the sernet packages. I was prompted to write this because I could not get a sernet member server to allow me to login via smbclient or 'caja' on LinuxMint. Rowland
On 15-01-10 07:31 AM, Rowland Penny wrote:> On 10/01/15 14:43, Bob of Donelson Trophy wrote: >> >> I have been reviewing Louis' script >> (4-setup-sernet-samba4-MEMBER-wheezy.sh) and within the following line >> (310) is an odd character combination. >> >> if [ ${SMBPRINTING} = no ]; then >> echo "==========Disable Printing ===============================" >> sed -i '49a\n # disable printing completelyn load printers = non >> printing = bsdn printcap name = /dev/nulln disable spoolss = yesn'^M >> <<<<<<< WHAT? >> /etc/samba/smb.conf >> fi >> >> I am using vi editor (Debian 7.7.0) and noticed "^M" at the end of the >> line. This character combination appears twice within the script. Both >> time as a unique font color. Here listed above and finally on the last >> line of the script. In 'test' removing the character combination the >> cursor responds as though this is a single character. In other words, a >> single keystroke removes both characters. >> >> Is this a necessary character for the script to function properly? Or is >> it rogue and causing some unforeseen issues? >> >> (I feel bad raising this question while Louis is on a holiday. Many of >> us have been using his script for some time now and history indicates >> that they are working scripts. And I for one really appreciate all the >> work that went into them.) >> > > Hi Bob, you seem to have more wrong than you think, this is the block of > code you are referring to: > > if [ ${SMBPRINTING} = no ]; then > echo "==========Disable Printing ===============================" > sed -i '49a\\n # disable printing completely\n load printers > no\n printing = bsd\n printcap name = /dev/null\n disable spoolss > = yes\n' /etc/samba/smb.conf > fi > > The 'sed' line should be all one line and all the newlines seem to have > been turned into just an 'n', they should be '\n', try looking at the > script with gedit or nano. > > If you are interested, I now have a script to install a member server > using samba packages from debian backports instead of using the sernet > packages. I was prompted to write this because I could not get a sernet > member server to allow me to login via smbclient or 'caja' on LinuxMint. > > RowlandI would be *very* interested in that script, Rowland. I have been unable to get a member server to work with any form of ADDC, and I've been trying for a week. Just crashed out last night with Louis' script (both automated, and me working through it step by step). What version of samba is in the backports? and as a side note to Bob -- If I open the script directly from the website using gedit to open it from firefox (on a different, older ubuntu machine) I get all the correct formatting (I spent several hours working through it and all its assumptions, yesterday). But I haven't looked at it with vi. Maybe I will. maybe the sed command is showing up here broken incorrectly because of word-wrap in your newsreader client? Cheers! d.
On 2015-01-10 09:24, BISI wrote:> On 15-01-10 06:43 AM, Bob of Donelson Trophy wrote: > >> I have been reviewing Louis' script (4-setup-sernet-samba4-MEMBER-wheezy.sh) and within the following line (310) is an odd character combination. if [ ${SMBPRINTING} = no ]; then echo "==========Disable Printing ===============================" sed -i '49an # disable printing completelyn load printers = non printing = bsdn printcap name = /dev/nulln disable spoolss = yesn'^M <<<<<<< WHAT? /etc/samba/smb.conf fi I am using vi editor (Debian 7.7.0) and noticed "^M" at the end of the line. This character combination appears twice within the script. Both time as a unique font color. Here listed above and finally on the last line of the script. In 'test' removing the character combination the cursor responds as though this is a single character. In other words, a single keystroke removes both characters. Is this a necessary character for the script to function properly? Or is it rogue and causing some unforeseen issues? (I feel bad raising this question while Louis is on a holiday. Many of us have been using his script for some time now and history indicates that they are working scripts. And I for one really appreciate all the work that went into them.)> > IIRC the ^M (as a single character) is an artefact of windows CR/LF (newline) as represented in vi. > > you can get rid of it with dos2unix (apt-get install dos2unix) using something like > dos2unix < newFileName > 4-setup-sernet-samba4-MEMBER-wheezy.sh > > the vi I am using (vim.basic, added after install) does not show the ^M construct on files that I know have it (probably a setting somewhere) > > I believe ctrl+m will reproduce the "single character". In my instance of vi, it creates a newline without showing the ^M that I definitely remember seeing in my users (windows) logon scripts. > > Cheers! > d.Well, I thought is would turn out to be little of nothing. Historically, if the "^M" had had any effect to the script, it would have been dealt with before now. So, I can ignore it. Thank you for the education. I have been using linux for 10 years or so and still learning something new everyday. Love this OS!!! -- ------------------------- Bob Wooden of Donelson Trophy 615.885.2846 (main) www.donelsontrophy.com [1] "Everyone deserves an award!!" Links: ------ [1] http://www.donelsontrophy.com
On 2015-01-10 09:31, Rowland Penny wrote:> On 10/01/15 14:43, Bob of Donelson Trophy wrote: > >> I have been reviewing Louis' script (4-setup-sernet-samba4-MEMBER-wheezy.sh) and within the following line (310) is an odd character combination. if [ ${SMBPRINTING} = no ]; then echo "==========Disable Printing ===============================" sed -i '49an # disable printing completelyn load printers = non printing = bsdn printcap name = /dev/nulln disable spoolss = yesn'^M <<<<<<< WHAT? /etc/samba/smb.conf fi I am using vi editor (Debian 7.7.0) and noticed "^M" at the end of the line. This character combination appears twice within the script. Both time as a unique font color. Here listed above and finally on the last line of the script. In 'test' removing the character combination the cursor responds as though this is a single character. In other words, a single keystroke removes both characters. Is this a necessary character for the script to function properly? Or is it rogue and causing some unforeseen issues? (I feel bad raising this question while Louis is on a holiday. Many of us have been using his script for some time now and history indicates that they are working scripts. And I for one really appreciate all the work that went into them.)> > Hi Bob, you seem to have more wrong than you think, this is the block of code you are referring to: > > if [ ${SMBPRINTING} = no ]; then > echo "==========Disable Printing ===============================" > sed -i '49a\n # disable printing completelyn load printers = non printing = bsdn printcap name = /dev/nulln disable spoolss = yesn' /etc/samba/smb.conf > fi > > The 'sed' line should be all one line and all the newlines seem to have been turned into just an 'n', they should be 'n', try looking at the script with gedit or nano. > > If you are interested, I now have a script to install a member server using samba packages from debian backports instead of using the sernet packages. I was prompted to write this because I could not get a sernet member server to allow me to login via smbclient or 'caja' on LinuxMint. > > RowlandRowland, Yes, please send me your script (directly.) For many reasons I have restored my machine to pre-sernet-samba (basic Debian server install) and was going to run Louis script again. I would love to try your script. -- ------------------------- Bob Wooden of Donelson Trophy 615.885.2846 (main) www.donelsontrophy.com [1] "Everyone deserves an award!!" Links: ------ [1] http://www.donelsontrophy.com