Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Apr 2017 16:52:27 +0000 (UTC)
From:      Benedict Reuschling <bcr@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317378 - head/usr.bin/sed
Message-ID:  <201704241652.v3OGqRrR071499@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bcr (doc committer)
Date: Mon Apr 24 16:52:26 2017
New Revision: 317378
URL: https://svnweb.freebsd.org/changeset/base/317378

Log:
  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

Modified:
  head/usr.bin/sed/sed.1

Modified: head/usr.bin/sed/sed.1
==============================================================================
--- head/usr.bin/sed/sed.1	Mon Apr 24 16:49:30 2017	(r317377)
+++ head/usr.bin/sed/sed.1	Mon Apr 24 16:52:26 2017	(r317378)
@@ -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 ,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704241652.v3OGqRrR071499>