<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sed on Bigshans&#39; Blog</title>
    <link>https://bigshans.github.io/tags/sed/</link>
    <description>Recent content in Sed on Bigshans&#39; Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>bigshans</copyright>
    <lastBuildDate>Wed, 16 Feb 2022 17:11:39 +0800</lastBuildDate>
    <atom:link href="https://bigshans.github.io/tags/sed/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>sed 速记</title>
      <link>https://bigshans.github.io/post/sed-quickly-note/</link>
      <pubDate>Wed, 16 Feb 2022 17:11:39 +0800</pubDate>
      <guid>https://bigshans.github.io/post/sed-quickly-note/</guid>
      <description>&lt;p&gt;&lt;code&gt;sed&lt;/code&gt; 命令是一个强大的、基于行的文本处理命令，它仍被广泛使用。 &lt;code&gt;sed&lt;/code&gt; 借助正则表达式对文本的某行进行增删改查。&lt;/p&gt;&#xA;&lt;h2 id=&#34;基本格式&#34;&gt;基本格式&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;sed [options] {script} [input file]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;增&#34;&gt;增&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;cat pets.txt&#xA;# output:&#xA;# This is my cat&#xA;#   my cat&#39;s name is betty&#xA;# This is your dog&#xA;#   my dog&#39;s name is frank&#xA;# This is my fish&#xA;#   my fish&#39;s name is george&#xA;# This is my goat&#xA;#   my goat&#39;s name is adam&#xA;&#xA;sed &amp;quot;/fish/a I like fish too&amp;quot; pets.txt&#xA;# output:&#xA;# This is my cat&#xA;#   my cat&#39;s name is betty&#xA;# This is your dog&#xA;#   my dog&#39;s name is frank&#xA;# This is my fish&#xA;# I like fish too&#xA;#   my fish&#39;s name is george&#xA;# I like fish too&#xA;# This is my goat&#xA;#   my goat&#39;s name is adam&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;我们可以看到文本会被添加到匹配行的后面，如果想要将文本插入到行前面，则使用 &lt;code&gt;a&lt;/code&gt; 参数。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
