[colug-432] Script basic

Rob Funk rfunk at funknet.net
Wed May 13 15:04:17 EDT 2015


Scott Merrill wrote:
> > I think, however, that applies to new documents only and that I'll have
> > to run it through the tool. One think I don't undestand, though, is why
> > the CR/LF wasn't removed when I used both VI/VIM and NANO to backspace
> > the next line up and then back down.
> 
> I suspect that both vim and nano are using the line endings found
> when they opened the document.

I know that vim understands CRLF (DOS/Windows) EOLs (it wouldn't
surprise me if nano does), so when it opens a file with them it just
accepts that as the way all lines should end in that file.

This is one reason I like using the basic "nvi" version of vi, rather
than vim. That way I see the "^M" throughout the file, and can then
delete them all with:
  :%s/^V^M//g
(where ^V^M is control-V control-M)


> There is a strong argument to be made for not mixing line endings
> within a document.

There's also a strong argument for creating and editing scripts on a
Unix/Linux machine. :-)



More information about the colug-432 mailing list