<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Sed-Stream-Editor%2FC2%2FSed-substitute-command%2FEnglish</id>
		<title>Sed-Stream-Editor/C2/Sed-substitute-command/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Sed-Stream-Editor%2FC2%2FSed-substitute-command%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;action=history"/>
		<updated>2026-05-13T15:04:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54880&amp;oldid=prev</id>
		<title>Nancyvarkey at 08:22, 3 March 2021</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54880&amp;oldid=prev"/>
				<updated>2021-03-03T08:22:59Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 08:22, 3 March 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''sed ‘s/Unix/Linux/’'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''sed ‘s/Unix/Linux/’''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &amp;gt;&amp;gt; Enter&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Highlight according to narration'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Highlight according to narration'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Type,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Type,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''sed space''' within single quotes '''s forward slash Unix forward slash Linux forward slash''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &amp;gt;&amp;gt; Enter&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''sed space''' within single quotes '''s forward slash Unix forward slash Linux forward slash'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here '''‘s’''' indicates the '''substitute''' option.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here '''‘s’''' indicates the '''substitute''' option.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 115:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 117:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Press '''“Ctrl+D”''' keys to terminate the standard input.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Press '''“Ctrl+D”''' keys to terminate the standard input.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| '''sed ‘s/Unix/Linux/’'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| '''sed ‘s/Unix/Linux/’''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&amp;gt; Enter&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''&amp;gt;“unix is the most powerful OS” '''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''&amp;gt;“unix is the most powerful OS” ''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&amp;gt; Enter&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Let us execute the same '''command''' again.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Let us execute the same '''command''' again.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type '''unix is the most powerful OS&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''' and press '''Enter&lt;/del&gt;'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type '''unix is the most powerful OS'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that we have typed '''‘u’''' in lowercase in '''Unix'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that we have typed '''‘u’''' in lowercase in '''Unix'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 298:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 300:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Highlight the word '''Success''' in the output.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||Highlight the word '''Success''' in the output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also note that in certain lines it didn’t substitute with the word '''victory'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;||&lt;/ins&gt;Also note that in certain lines it didn’t substitute with the word '''victory'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is because '''Success''' word has capital ‘S’.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is because '''Success''' word has capital ‘S’.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54879&amp;oldid=prev</id>
		<title>Nirmala Venkat at 06:14, 2 March 2021</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54879&amp;oldid=prev"/>
				<updated>2021-03-02T06:14:59Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 06:14, 2 March 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 188:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 188:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this example, capital ‘'''G’ '''is the option to add '''line space''' to the file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this example, capital ‘'''G’ '''is the option to add '''line space''' to the file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''message.txt '''is the file &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;where &lt;/del&gt;the '''sed command''' will work with.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''message.txt '''is the file &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;which &lt;/ins&gt;the '''sed command''' will work with.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If no filename is provided with '''sed command''', then the '''command''' will work on standard input data.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If no filename is provided with '''sed command''', then the '''command''' will work on standard input data.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54875&amp;oldid=prev</id>
		<title>Nancyvarkey at 07:55, 1 March 2021</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54875&amp;oldid=prev"/>
				<updated>2021-03-01T07:55:15Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;amp;diff=54875&amp;amp;oldid=54872&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54872&amp;oldid=prev</id>
		<title>Nirmala Venkat: Created page with &quot; {| border=&quot;1&quot; |- || '''VISUAL CUE''' || '''NARRATION''' |- || '''Slide 1:''' || Welcome to the '''spoken tutorial '''on '''Sed substitute''' command. |- || '''Slide 2:'''  ''...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Sed-Stream-Editor/C2/Sed-substitute-command/English&amp;diff=54872&amp;oldid=prev"/>
				<updated>2021-02-25T12:27:56Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; {| border=&amp;quot;1&amp;quot; |- || &amp;#039;&amp;#039;&amp;#039;VISUAL CUE&amp;#039;&amp;#039;&amp;#039; || &amp;#039;&amp;#039;&amp;#039;NARRATION&amp;#039;&amp;#039;&amp;#039; |- || &amp;#039;&amp;#039;&amp;#039;Slide 1:&amp;#039;&amp;#039;&amp;#039; || Welcome to the &amp;#039;&amp;#039;&amp;#039;spoken tutorial &amp;#039;&amp;#039;&amp;#039;on &amp;#039;&amp;#039;&amp;#039;Sed substitute&amp;#039;&amp;#039;&amp;#039; command. |- || &amp;#039;&amp;#039;&amp;#039;Slide 2:&amp;#039;&amp;#039;&amp;#039;  &amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|| '''VISUAL CUE'''&lt;br /&gt;
|| '''NARRATION'''&lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide 1:'''&lt;br /&gt;
|| Welcome to the '''spoken tutorial '''on '''Sed substitute''' command.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide 2:'''&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|| In this tutorial, we will learn about:&lt;br /&gt;
* Workflow of '''Sed''' command&lt;br /&gt;
* Introduction to '''Sed''' command&lt;br /&gt;
* '''Sed''' '''substitute''' command &lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide 3:'''&lt;br /&gt;
&lt;br /&gt;
'''System requirements'''&lt;br /&gt;
|| This tutorial is recorded using&lt;br /&gt;
* '''Ubuntu Linux '''OS version 18.04 &lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide 4:'''&lt;br /&gt;
&lt;br /&gt;
'''Prerequisites'''&lt;br /&gt;
||To follow this tutorial,you should know &lt;br /&gt;
* Basics of Linux.&lt;br /&gt;
&lt;br /&gt;
If not, then go through the Linux spoken tutorials on this website.&lt;br /&gt;
|-&lt;br /&gt;
|| Slide 5:&lt;br /&gt;
&lt;br /&gt;
Code files &lt;br /&gt;
|| &lt;br /&gt;
* The files used in this tutorial are available in the '''Code Files '''link on this tutorial page.&lt;br /&gt;
* Please download and extract them&lt;br /&gt;
* Make a copy and then use them while practising&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Slide 4:Workflow of SED commands'''&lt;br /&gt;
&lt;br /&gt;
1. '''Read''' - '''Sed''' reads a line from the input stream. &lt;br /&gt;
&lt;br /&gt;
It can be a file or standard input.&lt;br /&gt;
&lt;br /&gt;
It is stored in an internal buffer called '''pattern buffer'''.&lt;br /&gt;
|| '''Sed''' follows a simple workflow: &lt;br /&gt;
&lt;br /&gt;
First''' Sed''' reads a line from the input stream. &lt;br /&gt;
&lt;br /&gt;
It can be a file or standard input.&lt;br /&gt;
&lt;br /&gt;
It is stored in an internal buffer called '''pattern buffer'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide 4(a):'''&lt;br /&gt;
&lt;br /&gt;
2. '''Execute''' – All '''Sed''' commands are executed sequentially on the pattern buffer.&lt;br /&gt;
&lt;br /&gt;
3. '''Display-''' Sends the modified content to the output stream. &lt;br /&gt;
&lt;br /&gt;
The pattern buffer will be empty after sending the data.&lt;br /&gt;
|| Second step is '''Execute'''.&lt;br /&gt;
&lt;br /&gt;
All '''Sed''' commands are executed sequentially on the pattern buffer.&lt;br /&gt;
&lt;br /&gt;
Third step is '''Display.'''&lt;br /&gt;
&lt;br /&gt;
It sends the modified content to the output stream. &lt;br /&gt;
&lt;br /&gt;
The pattern buffer will be empty after sending the data.&lt;br /&gt;
|-&lt;br /&gt;
|| Open the terminal&lt;br /&gt;
|| Open the terminal by pressing '''Ctrl+Alt+T '''keys simultaneously.&lt;br /&gt;
&lt;br /&gt;
Remember to press the '''Enter''' Key after every command.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| First let us see how to use the '''Sed''' command with standard input. &lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
'''sed ‘s/Unix/Linux/’'''&lt;br /&gt;
'''Highlight according to narration'''&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
&lt;br /&gt;
Unix is the most powerful OS&lt;br /&gt;
&lt;br /&gt;
Highlight the output&lt;br /&gt;
&lt;br /&gt;
Press Ctrl+d&lt;br /&gt;
||Type,&lt;br /&gt;
&lt;br /&gt;
'''sed''' space within single quotes '''s forward slash Unix forward slash Linux forward slash'''&lt;br /&gt;
&lt;br /&gt;
Here ‘s’ indicates the '''substitute''' option.&lt;br /&gt;
&lt;br /&gt;
'''substitute''' command will replace '''Unix''' with '''Linux'''.&lt;br /&gt;
&lt;br /&gt;
'''Sed''' command is mostly used to replace the text in a file.&lt;br /&gt;
&lt;br /&gt;
Here we are using the '''Sed''' command without a file.&lt;br /&gt;
&lt;br /&gt;
So it will process from standard input.&lt;br /&gt;
&lt;br /&gt;
Type '''Unix is the most powerful OS '''and press Enter&lt;br /&gt;
&lt;br /&gt;
We can see the '''Unix''' word is replaced with '''Linux'''.&lt;br /&gt;
&lt;br /&gt;
Press “Ctrl+d” key to terminate the standard input.&lt;br /&gt;
|-&lt;br /&gt;
|| '''sed ‘s/Unix/Linux/’'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;“unix is the most powerful OS” '''&lt;br /&gt;
&lt;br /&gt;
Highlight the small u in unix.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press “Ctrl+d&lt;br /&gt;
||Let us execute the same command again.&lt;br /&gt;
&lt;br /&gt;
Type '''unix is the most powerful OS''' and press Enter.&lt;br /&gt;
&lt;br /&gt;
Note that we have typed ‘u’ in lower case in unix.&lt;br /&gt;
&lt;br /&gt;
Here the replacement didn’t take place. &lt;br /&gt;
&lt;br /&gt;
This is because sed commands are case sensitive.&lt;br /&gt;
&lt;br /&gt;
Press “Ctrl+d” keys to return back to the command prompt.&lt;br /&gt;
|-&lt;br /&gt;
|| '''cd Downloads'''&lt;br /&gt;
&lt;br /&gt;
'''../Downloads&amp;gt;cat message.txt'''&lt;br /&gt;
&lt;br /&gt;
'''Highlight Downloads'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Highlight message.txt'''&lt;br /&gt;
|| I have saved a file '''message.txt '''in my downloads folder.&lt;br /&gt;
&lt;br /&gt;
Go to the directory where you have''' '''saved the '''message.txt''' on your system.&lt;br /&gt;
&lt;br /&gt;
Let us see the content of '''message.txt '''&lt;br /&gt;
&lt;br /&gt;
Type '''cat space message.txt '''&lt;br /&gt;
&lt;br /&gt;
I’ll be using this file for demonstration of sed commands.&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|-&lt;br /&gt;
|| '''&amp;gt;sed ‘’ message.txt'''&lt;br /&gt;
|| Let us read the content of the file '''message.txt '''using '''Sed'''.&lt;br /&gt;
&lt;br /&gt;
Type '''sed space a pair of single quotes space message.txt'''&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight according to narration&lt;br /&gt;
&lt;br /&gt;
|| Look at the output.&lt;br /&gt;
&lt;br /&gt;
It prints the content of the entire file.&lt;br /&gt;
&lt;br /&gt;
A pair of single quotes implies the '''Sed''' option.&lt;br /&gt;
&lt;br /&gt;
In our case there is no '''Sed''' option.&lt;br /&gt;
&lt;br /&gt;
So it prints the contents of the pattern buffer on the standard output.&lt;br /&gt;
|-&lt;br /&gt;
||'''Slide 6: Syntax:'''&lt;br /&gt;
&lt;br /&gt;
'''sed [options]...[command] [File]'''&lt;br /&gt;
&lt;br /&gt;
'''Example: '''&lt;br /&gt;
&lt;br /&gt;
'''sed G message.txt'''&lt;br /&gt;
|| The general syntax for '''Sed''' command is given here:&lt;br /&gt;
&lt;br /&gt;
In this example, capital ‘'''G’ '''is the option to add line space to the file.&lt;br /&gt;
&lt;br /&gt;
'''message.txt '''is the file where the sed command will work with.&lt;br /&gt;
&lt;br /&gt;
If no filename is provided with '''Sed '''command, then the command will work on standard input data.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
&amp;gt; '''sed G message.txt'''&lt;br /&gt;
&lt;br /&gt;
'''Highlight the output'''&lt;br /&gt;
||Let us execute the command and check the output.&lt;br /&gt;
&lt;br /&gt;
Type '''sed space G space message.txt '''&lt;br /&gt;
&lt;br /&gt;
We can observe line space is added to the output.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Next let us see about the substitute command.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide 7:'''&lt;br /&gt;
&lt;br /&gt;
'''Substitute command'''&lt;br /&gt;
&lt;br /&gt;
'''syntax:'''&lt;br /&gt;
&lt;br /&gt;
'''sed ‘s/oldstring/newstring/’ file'''&lt;br /&gt;
&lt;br /&gt;
'''sed ‘s/oldstring/newstring/’ file &amp;gt; output.txt'''&lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
Here ‘s’ specifies the substitute command.&lt;br /&gt;
&lt;br /&gt;
forward slash (/) is to delimit the two arguments. &lt;br /&gt;
&lt;br /&gt;
'''oldstring''' is the string to be searched from the file.&lt;br /&gt;
&lt;br /&gt;
'''newstring''' is the string to be replaced by the searched string.&lt;br /&gt;
&lt;br /&gt;
'''file''' is the input text file.&lt;br /&gt;
&lt;br /&gt;
The redirection symbol and a file name is used to redirect the output to another file.&lt;br /&gt;
&lt;br /&gt;
By default sed outputs everything to standard output instead of saving it in a file.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Switch back to terminal.&lt;br /&gt;
|-&lt;br /&gt;
||'''&amp;gt;sed s/success/victory/ message.txt'''&lt;br /&gt;
&lt;br /&gt;
'''Highlight where the replacement has not taken place'''&lt;br /&gt;
||Type &lt;br /&gt;
&lt;br /&gt;
'''sed space s forward slash success forward slash victory forward slash space message.txt'''&lt;br /&gt;
&lt;br /&gt;
This will replace the word success with the word victory in message.txt &lt;br /&gt;
&lt;br /&gt;
We can use '''sed''' commands without using single quotes.&lt;br /&gt;
&lt;br /&gt;
Note that the word '''success''' has been replaced with the word '''victory''' in a few places.&lt;br /&gt;
&lt;br /&gt;
I’ll explain later why the replacement didn’t take place in the entire file.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;sed s/success/great victory/ message.txt'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;sed ‘s/success/great victory/’ message.txt'''&lt;br /&gt;
&lt;br /&gt;
'''Highlight great victory'''&lt;br /&gt;
&lt;br /&gt;
||Now let us try this command with space in the string. &lt;br /&gt;
&lt;br /&gt;
Here we got an error and we didn’t get the expected output.&lt;br /&gt;
&lt;br /&gt;
Try the same command with single quotes as shown. &lt;br /&gt;
&lt;br /&gt;
So quotes are needed when we use space or a special shell character inside the command.&lt;br /&gt;
&lt;br /&gt;
It is good practice to write sed commands using quotes.&lt;br /&gt;
|-&lt;br /&gt;
||Highlight according to narration&lt;br /&gt;
&lt;br /&gt;
&amp;gt;'''sed ‘s/success/victory/’ message.txt'''&lt;br /&gt;
|| Let us see the various options with the substitute command.&lt;br /&gt;
&lt;br /&gt;
Type the command as shown.&lt;br /&gt;
&lt;br /&gt;
Note that this has changed '''success''' to '''victory''' once on each line.&lt;br /&gt;
&lt;br /&gt;
Sed replaces only the first match in each line with the substitute command. &lt;br /&gt;
&lt;br /&gt;
The last sentence has '''success''' twice. But it has changed only at one place.&lt;br /&gt;
&lt;br /&gt;
It will not replace the second or third occurrence in the same line.&lt;br /&gt;
&lt;br /&gt;
Also note that in certain lines it didn’t substitute with the word victory.&lt;br /&gt;
&lt;br /&gt;
This is because '''Success''' word has capital ‘S’.&lt;br /&gt;
&lt;br /&gt;
As we know, '''sed''' commands are case sensitive.&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;gt;'''sed ‘s/success/victory/ I’ message.txt'''&lt;br /&gt;
|| Type the command as shown.&lt;br /&gt;
&lt;br /&gt;
We can use the flag capital '''I''' to make the pattern match case insensitive.&lt;br /&gt;
&lt;br /&gt;
Look at the output.&lt;br /&gt;
|-&lt;br /&gt;
|| '''&amp;gt;sed ‘s/success/victory/ 2’ message.txt'''&lt;br /&gt;
&lt;br /&gt;
Highlight the last sentence&lt;br /&gt;
|| If you want to replace the 2nd occurrence in a line, use 2 as a flag as shown.&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;sed ‘s/success/victory/ 2’ message.txt'''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;gt;'''sed ‘s/success/victory/’ message.txt'''&lt;br /&gt;
|| What if we want to replace all the instances of matches in a file? &lt;br /&gt;
&lt;br /&gt;
Use the ‘g’ option to represent global replacement.&lt;br /&gt;
|-&lt;br /&gt;
|| '''&amp;gt;sed ‘s/success/victory/ Ig’ message.txt'''&lt;br /&gt;
|| Next we will see how to replace from nth occurrence to all the occurrences in a line.&lt;br /&gt;
&lt;br /&gt;
Type the command as shown.&lt;br /&gt;
&lt;br /&gt;
Here, we have used the capital '''I''' and '''g''' flags together.&lt;br /&gt;
&lt;br /&gt;
This will replace all the patterns globally with case insensitive.&lt;br /&gt;
|-&lt;br /&gt;
|| '''&amp;gt; cat message.txt'''&lt;br /&gt;
&lt;br /&gt;
'''Highlight ‘Albert’ at two places'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;sed '/Albert/s/success/victory/' message.txt'''&lt;br /&gt;
&lt;br /&gt;
|| Let us see another example.&lt;br /&gt;
&lt;br /&gt;
We want to replace the word success with victory in the line which contains the text '''‘Albert’'''.&lt;br /&gt;
&lt;br /&gt;
Type the command as shown.&lt;br /&gt;
&lt;br /&gt;
Let us check the output.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Let us see how the regular expression is used in substitute command.&lt;br /&gt;
|-&lt;br /&gt;
||'''&amp;gt; sed ‘s/[0-9]*//’ message.txt'''&lt;br /&gt;
&lt;br /&gt;
Highlight the output&lt;br /&gt;
|| Type,&lt;br /&gt;
&lt;br /&gt;
'''sed within single quotes s forward slash within square brackets 0 hyphen 9 asterisk forward slash forward slash space message.txt'''&lt;br /&gt;
&lt;br /&gt;
Here regular expression represents one or more occurrences of 0-9 characters.&lt;br /&gt;
&lt;br /&gt;
I want to replace it with the empty string.&lt;br /&gt;
&lt;br /&gt;
In the output we can see, all the line numbers are replaced with empty spaces.&lt;br /&gt;
|-&lt;br /&gt;
|| '''&amp;gt; sed ‘1,2 s/success/victory/g’ message.txt'''&lt;br /&gt;
|| We can also perform the substitute command on specific lines.&lt;br /&gt;
&lt;br /&gt;
Type the command as shown. &lt;br /&gt;
&lt;br /&gt;
We can see the replacement in the first two lines&lt;br /&gt;
|-&lt;br /&gt;
|| '''&amp;gt; sed ‘4,$ s/success/victory/g’ message.txt'''&lt;br /&gt;
||In this command, $ represents the last line.&lt;br /&gt;
&lt;br /&gt;
Here, replacement takes place from the fourth line to the last line.&lt;br /&gt;
|-&lt;br /&gt;
|| '''&amp;gt;&amp;gt; sed ‘/^2./ s/success/victory/’ message.txt'''&lt;br /&gt;
||We can select a particular line with the regular expressions to perform the substitute command.&lt;br /&gt;
&lt;br /&gt;
For example, in this command caret (^)symbol represents the beginning of the line.&lt;br /&gt;
&lt;br /&gt;
If the line begins with 2 dot, then on that line it will perform the substitute command.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| With this we come to the end of this tutorial. Let us summarize.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
Slide 8:&lt;br /&gt;
&lt;br /&gt;
Summary&lt;br /&gt;
|| In this tutorial, we learnt&lt;br /&gt;
* Work flow of '''Sed''' command&lt;br /&gt;
* Introduction to '''Sed''' command&lt;br /&gt;
* '''Sed''' '''substitute''' command &lt;br /&gt;
|-&lt;br /&gt;
|| Slide:9&lt;br /&gt;
&lt;br /&gt;
Assignment&lt;br /&gt;
|| As an assignment, try the below commands and see the output.&lt;br /&gt;
&lt;br /&gt;
# sed 's/[0-9.]*/(*)/' message.txt&lt;br /&gt;
# sed '/secrets/s/success/victory/g' message.txt&lt;br /&gt;
# sed 's/-/:/' message.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|| Slide 10:&lt;br /&gt;
&lt;br /&gt;
(About Spoken Tutorial Project)&lt;br /&gt;
|| The video at the following link, summarizes the''' Spoken Tutorial '''project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|| Slide 11:&lt;br /&gt;
&lt;br /&gt;
(About Spoken Tutorial Project)&lt;br /&gt;
|| The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
|-&lt;br /&gt;
|| Slide&lt;br /&gt;
&lt;br /&gt;
Forum questions:&lt;br /&gt;
||&lt;br /&gt;
* Do you have questions in THIS Spoken Tutorial?&lt;br /&gt;
* Please visit this site&lt;br /&gt;
* Choose the minute and second where you have the question&lt;br /&gt;
* Explain your question briefly&lt;br /&gt;
* The Spoken Tutorial project team will ensure an answer&lt;br /&gt;
* You will have to register on this website to ask questions.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide: '''Forum for specific&amp;amp;nbsp; Questions&lt;br /&gt;
&lt;br /&gt;
|| * The Spoken Tutorial forum is for specific questions on this tutorial.&lt;br /&gt;
* Please do not post unrelated and general questions on them.&lt;br /&gt;
* This will help reduce the clutter.&lt;br /&gt;
* With less clutter, we can use these discussions as instructional material.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide: '''Acknowledgement&lt;br /&gt;
&lt;br /&gt;
|| Spoken Tutorial project is funded by the Ministry of Education (MoE), Govt. of India.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| This is Pooja from Spoken Tutorial Project, IIT Bombay signing off.&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	</feed>