Skip to content

Commit

Permalink
Fix the last example to really replace all occurrences of the search …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
bsdbcr committed Apr 24, 2017
1 parent 82d986e commit 9ea8fcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr.bin/sed/sed.1
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand Down

0 comments on commit 9ea8fcf

Please sign in to comment.