<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Sed</id>
	<title>Sed - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Sed"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Sed&amp;action=history"/>
	<updated>2026-05-16T16:33:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=253&amp;oldid=prev</id>
		<title>Ardika Sulistija at 20:30, 3 October 2024</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=253&amp;oldid=prev"/>
		<updated>2024-10-03T20:30:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:30, 3 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l199&quot;&gt;Line 199:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 199:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;/&amp;quot;ExtensionInstallAllowlist&amp;quot;&amp;lt;/b&amp;gt;: \[/,/\],/: Searches between the start of the &amp;quot;ExtensionInstallAllowlist&amp;quot; list and the closing ],.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;/&amp;quot;ExtensionInstallAllowlist&amp;quot;&amp;lt;/b&amp;gt;: \[/,/\],/: Searches between the start of the &amp;quot;ExtensionInstallAllowlist&amp;quot; list and the closing ],.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;s/\(\s*\],\)/ &amp;quot;new_string&amp;quot;,\n\1/&amp;lt;/b&amp;gt;: Substitutes the closing ], with the new string followed by a newline and the original ],.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;s/\(\s*\],\)/ &amp;quot;new_string&amp;quot;,\n\1/&amp;lt;/b&amp;gt;: Substitutes the closing ], with the new string followed by a newline and the original ],.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** The &amp;lt;b&amp;gt;\1&amp;lt;/b&amp;gt; is a &quot;backreference&quot; that refers to what was captured (or matched). In this case, the &amp;lt;b&amp;gt;\1&amp;lt;/b&amp;gt; refers to the &amp;lt;b&amp;gt;(\s*\],\)&amp;lt;/b&amp;gt; which is the closing bracket &amp;lt;b&amp;gt;],&amp;lt;/b&amp;gt;. So it inserts the string\n before that. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** &amp;lt;i&amp;gt;Adjust spaces to match the indentation.&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** &amp;lt;i&amp;gt;Adjust spaces to match the indentation.&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;your_file.json&amp;lt;/b&amp;gt;: The file where the change will be made.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;your_file.json&amp;lt;/b&amp;gt;: The file where the change will be made.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=252&amp;oldid=prev</id>
		<title>Ardika Sulistija at 18:31, 3 October 2024</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=252&amp;oldid=prev"/>
		<updated>2024-10-03T18:31:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:31, 3 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l198&quot;&gt;Line 198:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 198:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;-i&amp;lt;/b&amp;gt;: Edits the file in place.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;-i&amp;lt;/b&amp;gt;: Edits the file in place.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;/&amp;quot;ExtensionInstallAllowlist&amp;quot;&amp;lt;/b&amp;gt;: \[/,/\],/: Searches between the start of the &amp;quot;ExtensionInstallAllowlist&amp;quot; list and the closing ],.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;/&amp;quot;ExtensionInstallAllowlist&amp;quot;&amp;lt;/b&amp;gt;: \[/,/\],/: Searches between the start of the &amp;quot;ExtensionInstallAllowlist&amp;quot; list and the closing ],.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;lt;b&amp;gt;s/\(\s*\],\)/ &quot;new_string&quot;,\n\1/&amp;lt;/b&amp;gt;: Substitutes the closing ], with the new string followed by a newline and the original ],. Adjust spaces to match the indentation.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;lt;b&amp;gt;s/\(\s*\],\)/ &quot;new_string&quot;,\n\1/&amp;lt;/b&amp;gt;: Substitutes the closing ], with the new string followed by a newline and the original ],.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** &amp;lt;i&amp;gt;&lt;/ins&gt;Adjust spaces to match the indentation.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/i&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;your_file.json&amp;lt;/b&amp;gt;: The file where the change will be made.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;b&amp;gt;your_file.json&amp;lt;/b&amp;gt;: The file where the change will be made.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Replace &amp;quot;new_string&amp;quot; with the actual string you want to add, and your_file.json with the path to your file.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Replace &amp;quot;new_string&amp;quot; with the actual string you want to add, and your_file.json with the path to your file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=251&amp;oldid=prev</id>
		<title>Ardika Sulistija at 18:29, 3 October 2024</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=251&amp;oldid=prev"/>
		<updated>2024-10-03T18:29:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:29, 3 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l174&quot;&gt;Line 174:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 174:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;https://www.theunixschool.com/2014/08/sed-examples-remove-delete-chars-from-line-file.html&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;https://www.theunixschool.com/2014/08/sed-examples-remove-delete-chars-from-line-file.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;====How to target a specific String and insert a new string between some other character/string====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;====How to target a specific String and insert a new string between some other character/string====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this example, we will use the following list as an example:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this example, we will use the following list as an example:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=250&amp;oldid=prev</id>
		<title>Ardika Sulistija at 18:28, 3 October 2024</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=250&amp;oldid=prev"/>
		<updated>2024-10-03T18:28:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:28, 3 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l173&quot;&gt;Line 173:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 173:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;https://www.theunixschool.com/2014/08/sed-examples-remove-delete-chars-from-line-file.html&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;https://www.theunixschool.com/2014/08/sed-examples-remove-delete-chars-from-line-file.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=====How to target a specific String and insert a new string between some other character/string====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;----&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In this example, we will use the following list as an example:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &quot;Budapest&quot;: [ &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;       &quot;abc&quot;, &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;       &quot;def&quot;, &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;       &quot;ghi&quot;, &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   ], &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &quot;ExtensionInstallAllowlist&quot;: [&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;       &quot;abc&quot;, &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;       &quot;def&quot;, &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;       &quot;ghi&quot;, &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   ],&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;So how can you insert a new string at the end of the &quot;ExtensionInstallAllowlist&quot; list, but before the &quot;],&quot; if there are multiple strings ( &quot;ExtensionInstallAllowlist&quot; vs  &quot;Budapest&quot; ) to differentiate from?&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You can target the &quot;ExtensionInstallAllowlist&quot; list specifically and insert a new string before the ], using the following sed command:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; sed -i &#039;/&quot;ExtensionInstallAllowlist&quot;: \[/,/\],/s/\(\s*\],\)/      &quot;new_string&quot;,\n\1/&#039; your_file.json&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Explanation:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;b&amp;gt;-i&amp;lt;/b&amp;gt;: Edits the file in place.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;b&amp;gt;/&quot;ExtensionInstallAllowlist&quot;&amp;lt;/b&amp;gt;: \[/,/\],/: Searches between the start of the &quot;ExtensionInstallAllowlist&quot; list and the closing ],.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;b&amp;gt;s/\(\s*\],\)/ &quot;new_string&quot;,\n\1/&amp;lt;/b&amp;gt;: Substitutes the closing ], with the new string followed by a newline and the original ],. Adjust spaces to match the indentation.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;b&amp;gt;your_file.json&amp;lt;/b&amp;gt;: The file where the change will be made.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Replace &quot;new_string&quot; with the actual string you want to add, and your_file.json with the path to your file.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=173&amp;oldid=prev</id>
		<title>Ardika Sulistija: Created page with &quot;ADD NOTES: https://stackoverflow.com/questions/29399790/comment-out-lines-in-fstab-with-bash-script &lt;/br&gt; https://www.bitdoze.com/sed-insert-append-text/#appending-text-with-sed  You can use sed to print out specific lines of a file. I&#039;m sure there&#039;s more you can do with sed but this is what I have for now.    How to remove a line that contains a string like &quot;aws-replication&quot; from a file:  # grep -i aws-replication test  disk:x:6:aws-replication  aws-replication:x:1001:...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Sed&amp;diff=173&amp;oldid=prev"/>
		<updated>2024-09-11T14:27:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;ADD NOTES: https://stackoverflow.com/questions/29399790/comment-out-lines-in-fstab-with-bash-script &amp;lt;/br&amp;gt; https://www.bitdoze.com/sed-insert-append-text/#appending-text-with-sed  You can use sed to print out specific lines of a file. I&amp;#039;m sure there&amp;#039;s more you can do with sed but this is what I have for now.    How to remove a line that contains a string like &amp;quot;aws-replication&amp;quot; from a file:  # grep -i aws-replication test  disk:x:6:aws-replication  aws-replication:x:1001:...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;ADD NOTES: https://stackoverflow.com/questions/29399790/comment-out-lines-in-fstab-with-bash-script&lt;br /&gt;
&amp;lt;/br&amp;gt;&lt;br /&gt;
https://www.bitdoze.com/sed-insert-append-text/#appending-text-with-sed&lt;br /&gt;
&lt;br /&gt;
You can use sed to print out specific lines of a file. I&amp;#039;m sure there&amp;#039;s more you can do with sed but this is what I have for now. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to remove a line that contains a string like &amp;quot;aws-replication&amp;quot; from a file:&lt;br /&gt;
 # grep -i aws-replication test&lt;br /&gt;
 disk:x:6:aws-replication&lt;br /&gt;
 aws-replication:x:1001:&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # sed -i  &amp;#039;/aws-replication/d&amp;#039; ./test &lt;br /&gt;
 # grep -i aws-replication test&lt;br /&gt;
 (no output as lines were deleted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage&lt;br /&gt;
 $ cat file&lt;br /&gt;
 Line 1&lt;br /&gt;
 Line 2&lt;br /&gt;
 Line 3&lt;br /&gt;
 Line 4&lt;br /&gt;
 Line 5&lt;br /&gt;
 Line 6&lt;br /&gt;
 Line 7&lt;br /&gt;
 Line 8&lt;br /&gt;
 Line 9&lt;br /&gt;
 Line 10&lt;br /&gt;
&lt;br /&gt;
To print one line (5)&lt;br /&gt;
 $ sed -n 5p file&lt;br /&gt;
 Line 5&lt;br /&gt;
&lt;br /&gt;
To print multiple lines (5 &amp;amp; 8)&lt;br /&gt;
 $ sed -n -e 5p -e 8p file&lt;br /&gt;
 Line 5&lt;br /&gt;
 Line 8&lt;br /&gt;
&lt;br /&gt;
To print specific range (5 - 8)&lt;br /&gt;
 $ sed -n 5,8p file&lt;br /&gt;
 Line 5&lt;br /&gt;
 Line 6&lt;br /&gt;
 Line 7&lt;br /&gt;
 Line 8&lt;br /&gt;
&lt;br /&gt;
To print range with other specific line (5 - 8 &amp;amp; 10)&lt;br /&gt;
 $ sed -n -e 5,8p -e 10p file&lt;br /&gt;
 Line 5&lt;br /&gt;
 Line 6&lt;br /&gt;
 Line 7&lt;br /&gt;
 Line 8&lt;br /&gt;
 Line 10 &lt;br /&gt;
&lt;br /&gt;
To remove the last character in a file, and pipe the new output back to the file using &amp;lt;b&amp;gt;tee&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo sed &amp;#039;$ s/.$//&amp;#039;  /etc/cloud/cloud.cfg.d/99-datasource.cfg | tee /etc/cloud/cloud.cfg.d/99-datasource.cfg&lt;br /&gt;
 &amp;#039;datasource_list&amp;#039;: [&lt;br /&gt;
                &amp;#039;Ec2&amp;#039;,&lt;br /&gt;
                &amp;#039;None&amp;#039;&lt;br /&gt;
            ]&lt;br /&gt;
&lt;br /&gt;
To comment out a particular line or add something in front of a line:&lt;br /&gt;
 $ cat testfile &lt;br /&gt;
 1&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 &lt;br /&gt;
 $ sed -i &amp;#039;2 s/^/#/&amp;#039; testfile &lt;br /&gt;
 &lt;br /&gt;
 $ cat testfile &lt;br /&gt;
 1&lt;br /&gt;
 #2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
&lt;br /&gt;
To comment out multiple lines (i.e. lines 2 through 4):&lt;br /&gt;
 $ cat testfile &lt;br /&gt;
 1&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 &lt;br /&gt;
 $ sed -i &amp;#039;2,4 s/^/#/&amp;#039; testfile &lt;br /&gt;
 &lt;br /&gt;
 $ cat testfile &lt;br /&gt;
 1&lt;br /&gt;
 #2&lt;br /&gt;
 #3&lt;br /&gt;
 #4&lt;br /&gt;
&lt;br /&gt;
$ sed &amp;#039;/AllowUsers/s/$/ centos2/&amp;#039; testfile &lt;br /&gt;
 1&lt;br /&gt;
 #2&lt;br /&gt;
 #3&lt;br /&gt;
 #4&lt;br /&gt;
 AllowUsers ec2-user centos2&lt;br /&gt;
&lt;br /&gt;
====How to replace words/characters in a file====&lt;br /&gt;
----&lt;br /&gt;
* &amp;quot;&amp;lt;b&amp;gt;-i&amp;lt;/b&amp;gt; means to do an in-place edit. Without &amp;lt;b&amp;gt;-i&amp;lt;/b&amp;gt;, then it doesn&amp;#039;t make an actual edit but it will print the result. Use without &amp;lt;b&amp;gt;-i&amp;lt;/b&amp;gt; for testing purposes is very helpful. &lt;br /&gt;
sed -i s/A/B/g means replace A with B:&lt;br /&gt;
&lt;br /&gt;
 # cat test.file&lt;br /&gt;
 linux&lt;br /&gt;
  &lt;br /&gt;
 # sed -i s,linux,linux_replaced,g test.file&lt;br /&gt;
 &lt;br /&gt;
 # cat test.file&lt;br /&gt;
 linux_replaced&lt;br /&gt;
 &lt;br /&gt;
 ------- Alternative:&lt;br /&gt;
 &lt;br /&gt;
 # sed -i s/linux_replaced/linux/g test.file&lt;br /&gt;
 &lt;br /&gt;
 # cat test.file&lt;br /&gt;
 linux&lt;br /&gt;
 &lt;br /&gt;
=====How to replace strings with special characters=====&lt;br /&gt;
----&lt;br /&gt;
This replaces the string &amp;lt;b&amp;gt;UUID=asfdsffd-a264-4fe2-84dc-33de230c4200&amp;lt;/b&amp;gt; with &amp;lt;b&amp;gt;/dev/mapper/vgroot-lvroot&amp;lt;/b&amp;gt;.&lt;br /&gt;
 sed -i &amp;quot;s/UUID=asfdsffd-a264-4fe2-84dc-33de230c4200/\/dev\/mapper\/vgroot-lvroot/g&amp;quot; &amp;lt;file&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
=====How to replace long strings with spaces=====&lt;br /&gt;
----&lt;br /&gt;
 # cat test.file &lt;br /&gt;
 linux /vmlinuz-3.10.0-1160.21.1.el7.x86_64 root=/dev/mapper/vglocal00-root00 ro crashkernel=auto biosdevname=1 modprobe.blacklist=mpt3sas net.ifnames=0 nomodeset rdblacklist=bfa,lpfc consoleblank=0 LANG=en_US.UTF-8 console=ttyS0 rd_NO_LVMCONF rd.lvm.conf=0&lt;br /&gt;
 &lt;br /&gt;
 # sed &amp;quot;s:crashkernel=auto biosdevname=1 modprobe.blacklist=mpt3sas net.ifnames=0 nomodeset rdblacklist=bfa,lpfc consoleblank=0 LANG=en_US.UTF-8 ::g&amp;quot; test.file &lt;br /&gt;
 linux /vmlinuz-3.10.0-1160.21.1.el7.x86_64 root=/dev/mapper/vglocal00-root00 ro console=ttyS0 rd_NO_LVMCONF rd.lvm.conf=0&lt;br /&gt;
 &lt;br /&gt;
 ----- or with -i ------&lt;br /&gt;
 &lt;br /&gt;
 # sed -i &amp;quot;s:crashkernel=auto biosdevname=1 modprobe.blacklist=mpt3sas net.ifnames=0 nomodeset rdblacklist=bfa,lpfc consoleblank=0 LANG=en_US.UTF-8 ::g&amp;quot; test.file &lt;br /&gt;
 &lt;br /&gt;
 # cat test.file &lt;br /&gt;
 linux /vmlinuz-3.10.0-1160.21.1.el7.x86_64 root=/dev/mapper/vglocal00-root00 ro console=ttyS0 rd_NO_LVMCONF rd.lvm.conf=0&lt;br /&gt;
&lt;br /&gt;
References: https://unix.stackexchange.com/questions/288521/with-the-linux-cat-command-how-do-i-show-only-certain-lines-by-number&lt;br /&gt;
&lt;br /&gt;
=====How to add a character at the beginning of a line that contains a specific string=====&lt;br /&gt;
----&lt;br /&gt;
This will add a &amp;lt;b&amp;gt;&amp;#039;#&amp;#039;&amp;lt;/b&amp;gt; at the beginning of the lines that contain the string &amp;lt;b&amp;gt;&amp;#039;asfdsffd-a264-4fe2-84dc-33de230c4200&amp;#039;&amp;lt;/b&amp;gt;. &lt;br /&gt;
 sed -i &amp;#039;/asfdsffd-a264-4fe2-84dc-33de230c4200/ s/^/#/&amp;#039; ./etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====How to &amp;quot;append&amp;quot;/replace a string after finding a match=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Template:&lt;br /&gt;
 sed -i &amp;#039;/&amp;lt;find_line_that_matches_this_string/ s/&amp;lt;string_to_replace&amp;gt;/&amp;lt;replacement_string&amp;gt;/g&amp;#039; &amp;lt;file&amp;gt;&lt;br /&gt;
 sed -i &amp;#039;/X/ s/Y/Z/g&amp;#039; &amp;lt;file&amp;gt;&lt;br /&gt;
* Find line that has &amp;lt;b&amp;gt;X&amp;lt;/b&amp;gt;. Then replace &amp;lt;b&amp;gt;Y&amp;lt;/b&amp;gt; with &amp;lt;b&amp;gt;Z&amp;lt;/b&amp;gt; in that line. &lt;br /&gt;
&lt;br /&gt;
This will find the line with &amp;quot;&amp;lt;b&amp;gt;zzzsdfsf-a264-4fe2-84dc-123213124131&amp;lt;/b&amp;gt;&amp;quot;, and replace &amp;quot;defaults&amp;quot; with &amp;quot;defaults,x-systemd.device-timeout=300&amp;quot;:&lt;br /&gt;
 $ cat fstab&lt;br /&gt;
 UUID=77777f7f-b4f4-4ee4-b03f-c07c3f6f9act   /   xfs defaults    0   0&lt;br /&gt;
 UUID=fdsa1389-b288-4175-ba95-fdsa43fdsf23   /boot   xfs defaults    0   0&lt;br /&gt;
 UUID=abcdefgf-5022-1212-8cae-32424324fds3   /var  xfs defaults    0   0&lt;br /&gt;
 UUID=zzzzzzzz-27ff-4732-8a24-8a2432434324   swap    swap    defaults    0   0&lt;br /&gt;
 UUID=zzzsdfsf-a264-4fe2-84dc-123213124131   /test   xfs defaults    0   0&lt;br /&gt;
 &lt;br /&gt;
 $ sed &amp;#039;/zzzsdfsf-a264-4fe2-84dc-123213124131/ s/defaults/defaults,x-systemd.device-timeout=300/g&amp;#039; fstab&lt;br /&gt;
 UUID=77777f7f-b4f4-4ee4-b03f-c07c3f6f9act   /   xfs defaults    0   0&lt;br /&gt;
 UUID=fdsa1389-b288-4175-ba95-fdsa43fdsf23   /boot   xfs defaults    0   0&lt;br /&gt;
 UUID=abcdefgf-5022-1212-8cae-32424324fds3   /var  xfs defaults    0   0&lt;br /&gt;
 UUID=zzzzzzzz-27ff-4732-8a24-8a2432434324   swap    swap    defaults    0   0&lt;br /&gt;
 UUID=zzzsdfsf-a264-4fe2-84dc-123213124131   /test   xfs defaults,x-systemd.device-timeout=300    0   0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html&lt;br /&gt;
&lt;br /&gt;
https://www.theunixschool.com/2014/08/sed-examples-remove-delete-chars-from-line-file.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====sed: -e expression #1, char 193: unknown option to `s&amp;#039;====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you get the error &amp;lt;b&amp;gt;sed: -e expression #1, char 193: unknown option to `s&amp;#039;&amp;lt;/b&amp;gt;, likely there is some syntax issue like a &amp;lt;b&amp;gt;/&amp;lt;/b&amp;gt;. You would have to use &amp;lt;b&amp;gt;\&amp;lt;/b&amp;gt; delimiter like:&lt;br /&gt;
 sed &amp;#039;/vmlinuz-/ s/something\/to\/replace/rd.lvm.vg=VG01/g&amp;#039; grub.cfg&lt;br /&gt;
* This replaces &amp;quot;&amp;lt;b&amp;gt;something/to/replace&amp;lt;/b&amp;gt;&amp;quot; with &amp;lt;b&amp;gt;rd.lvm.vg=VG01&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Another example. Trying to replace a string that has &amp;#039;goodboy&amp;#039;:&lt;br /&gt;
 sed s,\&amp;#039;\goodboy\&amp;#039;\,,g &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Another example if you are trying to replace a string with another string that has a &amp;#039;,&amp;#039; (use: \\,\\)&lt;br /&gt;
 sed s,&amp;lt;string_to_replace&amp;gt;,\&amp;#039;hd0\\,\\gpt2\&amp;#039;,g &amp;lt;file&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>