=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/grep/grep.1,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- src/usr.bin/grep/grep.1 2019/12/03 08:48:49 1.50 +++ src/usr.bin/grep/grep.1 2022/06/26 10:57:36 1.51 @@ -1,4 +1,4 @@ -.\" $OpenBSD: grep.1,v 1.50 2019/12/03 08:48:49 kn Exp $ +.\" $OpenBSD: grep.1,v 1.51 2022/06/26 10:57:36 op Exp $ .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -28,7 +28,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd $Mdocdate: December 3 2019 $ +.Dd $Mdocdate: June 26 2022 $ .Dt GREP 1 .Os .Sh NAME @@ -49,6 +49,7 @@ .Op Fl -context Ns Op = Ns Ar num .Op Fl -label Ns = Ns Ar name .Op Fl -line-buffered +.Op Fl -null .Op Ar pattern .Op Ar .Ek @@ -297,6 +298,15 @@ Force output to be line buffered. By default, output is line buffered when standard output is a terminal and block buffered otherwise. +.It Fl -null +Output a zero byte instead of the character that normally follows a +file name. +This option makes the output unambiguous, even in the presence of file +names containing unusual characters like newlines. +This is similar to the +.Ar -print0 +option in +.Xr find 1 . .El .Sh EXIT STATUS The