How does the vi/vim editor remove lineterminator)

Source: Internet
Author: User
{Code ...} the result is as follows: however: {code ...} the result is as follows: Yes, cat has a termination mark, and the file will display withnolineterminators. However, you can edit it with vim, save it, and have a line terminator. using nano, you can see this line break, but I don't...
Vim hello.txt # Input hello #: wq to save and exit cat hello.txt

The result is as follows:

However:

echo -n "hello" > hello.txtcat hello.txt

The result is as follows:

Yes, cat has a termination mark at this time, and the file will display with no line terminators

However, you can edit it with vim, save it, and have a line terminator.

You can see this line feed using nano, but I won't use nano too often (don't laugh)

-- The following content has nothing to do with the subject, but only describes the background of the accident --

This problem caused me to have an extra line break when I use ssi in nginx, so that the style and js address are spliced with line breaks, and most browsers cannot load normally.


  

File: cdn. inc. manually edited the file by vim, causing the style of most users on the website to fail to be noticed (more line breaks)

mydomain.com

File: version. inc. the script updates the file when it goes online to clear the browser cache.

1477452280307

Reply content:
Vim hello.txt # Input hello #: wq to save and exit cat hello.txt

The result is as follows:

However:

echo -n "hello" > hello.txtcat hello.txt

The result is as follows:

Yes, cat has a termination mark at this time, and the file will display with no line terminators

However, you can edit it with vim, save it, and have a line terminator.

You can see this line feed using nano, but I won't use nano too often (don't laugh)

-- The following content has nothing to do with the subject, but only describes the background of the accident --

This problem caused me to have an extra line break when I use ssi in nginx, so that the style and js address are spliced with line breaks, and most browsers cannot load normally.


  

File: cdn. inc. manually edited the file by vim, causing the style of most users on the website to fail to be noticed (more line breaks)

mydomain.com

File: version. inc. the script updates the file when it goes online to clear the browser cache.

1477452280307

:set noendofline binary:w

Check whether set ff is set to dos.

In linux, it is generally set ff = unix configuration, right?

----- Edit ----
After the experiment, it seems that it has nothing to do with ff -. -

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.