In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Remove the ^ M symbol background displayed in the file
For files edited under windows, the ^ M symbol sometimes appears when opened with vim under Linux.
Principle
The contents of this section are referred to [1]
Vim is configured as fileformat=unix, and the files you open are in dos format. The newline character in unix format is 0A (ascii code), that is, the newline character in dos format is 0D 0A (that is,), which is actually displayed as ^ M.
Think back to the prehistory of computers, when typewriters used two characters to start a new line. First, a character command moves the print head back to the start position (enter,), and then another character command controls the feed line (feed,).
In the early days of computers, storage devices were very expensive. So it is suggested that there is no need to use two characters to indicate the end of a line:
The UNIX family decided to use only one feed character to represent the end of the line. People from Apple's mac camp use carriage return as the standard for changing lines. MS-DOS (and Microsoft's Windows) still decided to follow the old tradition of carriage return.
This also means that if you move files from one system to another, you will encounter problems associated with line breaks.
Solution method
Today, I stumbled upon a good way to remove ^ M:
Specify the filename: sed-I "s /\ srabbit plaza g" filename all the files in the current directory: sed-I "sr /\ srabbit racket placca g" `ls`
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.