Merge pull request #807 from tldr-pages/replace-on-matched-line

Sed: adds replace before matching sample
waldyrious/alt-syntax
Waldir Pimenta 2016-03-01 13:39:03 +00:00
commit 4e4d430223
1 changed files with 4 additions and 0 deletions

View File

@ -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}}`