Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of an example of adding a blank line above and below a sed matching line

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the example analysis of adding a blank line above and below the sed matching line. The article is very detailed and has a certain reference value. Interested friends must read it!

Sed'/ regex/ {x _ Tinct _ x _ TX _ G;}'

Mode space is pattern space in sedline; keep space is hold space

Step 1, the pattern space gets the regex matching row, leaving the space empty

Step 2 Pert x to maintain the exchange of space and pattern space

Step 3 dint p executes, printing as an empty pattern space, keeping the space as the regex matching line

Before the execution of step 4 regex x, because the matching line cannot be found, the pattern space is empty and the space is kept as the first matching row.

After the execution of step 5 regex x, the pattern space matches the row for the first time, leaving the space blank

Step 6, after the execution of par G, add the hold space to the pattern space matching line

The above is all the contents of the article "sample Analysis of adding a blank line above and below the sed matching line". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report