aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorBenedict Reuschling <bcr@FreeBSD.org>2017-04-24 16:52:26 +0000
committerBenedict Reuschling <bcr@FreeBSD.org>2017-04-24 16:52:26 +0000
commit0ae98ab709b9ff06d6bc68274f2e9890614800ce (patch)
tree6c110f3fcb1fb48b636e8fecf9c5b2ca596b3fe1 /usr.bin/sed
parent868f280a540ec32deb99597482c73865fa542ea4 (diff)
downloadsrc-0ae98ab709b9ff06d6bc68274f2e9890614800ce.tar.gz
src-0ae98ab709b9ff06d6bc68274f2e9890614800ce.zip
Fix the last example to really replace all occurrences of the search string
in the file by adding the global (g) option at the end. Without it, only the first match is replaced, subsequent ones are ignored. The intention of the example is to demonstrate something else, but adding the g matches the example to what the description says. Discussed with: brd (on IRC) MFC after: 1 week
Notes
Notes: svn path=/head/; revision=317378
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/sed.12
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1
index 03c70db7f1db..3f36bd0b84af 100644
--- a/usr.bin/sed/sed.1
+++ b/usr.bin/sed/sed.1
@@ -614,7 +614,7 @@ in the file
.Pa test.txt ,
without creating a backup of the file:
.Bd -literal -offset indent
-sed -i '' -e 's/foo/bar/' test.txt
+sed -i '' -e 's/foo/bar/g' test.txt
.Ed
.Sh SEE ALSO
.Xr awk 1 ,