FastHandle is fast operation tools for infrastructure configurations and tests.
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
appendix:sed.html [2018/02/02 01:14] kurihara |
appendix:sed.html [2018/03/05 18:56] kurihara [Substitution] |
||
---|---|---|---|
Line 10: | Line 10: | ||
+ | \\ | ||
\\ | \\ | ||
===== Example ===== | ===== Example ===== | ||
Line 29: | Line 29: | ||
</ | </ | ||
+ | \\ | ||
==== Append row==== | ==== Append row==== | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
Line 45: | Line 46: | ||
+ | \\ | ||
==== Insert row==== | ==== Insert row==== | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
Line 61: | Line 62: | ||
</ | </ | ||
+ | \\ | ||
==== Substitution ==== | ==== Substitution ==== | ||
+ | <sxh bash toolbar: | ||
+ | $ cat test.txt | ||
+ | 123 | ||
+ | 456 | ||
+ | abc | ||
+ | def | ||
+ | $ cat test.txt | sed ' | ||
+ | 123 | ||
+ | 789 | ||
+ | abc | ||
+ | def | ||
+ | </ | ||
+ | |||
<sxh bash toolbar: | <sxh bash toolbar: | ||
$ cat test.txt | $ cat test.txt | ||
Line 69: | Line 84: | ||
</ | </ | ||
+ | \\ | ||
+ | === Replace if matched=== | ||
+ | <sxh bash toolbar: | ||
+ | sed -i '/ | ||
+ | </ | ||
+ | |||
+ | \\ | ||
==== Reuse ==== | ==== Reuse ==== | ||
If it is enclosed by \(target character string \), it is partially reused such as \1, \2, \3, ... of the replaced character string | If it is enclosed by \(target character string \), it is partially reused such as \1, \2, \3, ... of the replaced character string |
My Sites
SNS
Copyright (c) 2024 FastHandle - IT Operations Examples All Rights Reserved.