mirror of https://github.com/CrimsonTome/tldr.git
Merge pull request #807 from tldr-pages/replace-on-matched-line
Sed: adds replace before matching samplewaldyrious/alt-syntax
commit
4e4d430223
|
@ -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}}`
|
||||
|
|
Loading…
Reference in New Issue