Merge pull request #807 from tldr-pages/replace-on-matched-line
Sed: adds replace before matching sample
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
|
||||
`sed 's/{{find}}/{{replace}}/' {{filename}}`
|
||||
|
||||
- Replace only on lines matching the line pattern:
|
||||
|
||||
`sed '/{{line_pattern}}/s/{{find}}/{{replace}}/'`
|
||||
|
||||
- Replace all occurrences of a string in a file, overwriting the file (i.e. in-place):
|
||||
|
||||
`sed -i 's/{{find}}/{{replace}}/g' {{filename}}`
|
||||
|
Reference in New Issue
Block a user