FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


appendix:sed.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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:
 </sxh> </sxh>
  
 +\\
 ==== Append row==== ==== Append row====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 45: Line 46:
  
  
 +\\
 ==== Insert row==== ==== Insert row====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 61: Line 62:
 </sxh> </sxh>
  
 +\\
 ==== Substitution ==== ==== Substitution ====
 +<sxh bash toolbar:false gutter:false>
 +$ cat test.txt
 +123
 +456
 +abc
 +def
 +$ cat test.txt | sed 's/456/789/g'
 +123
 +789
 +abc
 +def
 +</sxh>
 +
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 $  cat test.txt $  cat test.txt
Line 69: Line 84:
 </sxh> </sxh>
  
 +\\
 +=== Replace if matched===
 +<sxh bash toolbar:false gutter:false>
 +sed -i '/disable/ s/yes/no/' /etc/xinetd.d/tftp"
 +</sxh>
  
 +
 +\\
 ==== 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


appendix/sed.html.txt ยท Last modified: 2020/02/28 23:14 by kurihara