Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Aug 2017 01:22:39 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r322525 - stable/11/usr.bin/grep
Message-ID:  <201708150122.v7F1MdN2068429@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Aug 15 01:22:39 2017
New Revision: 322525
URL: https://svnweb.freebsd.org/changeset/base/322525

Log:
  bsdgrep: treat rgrep as grep -r and install rgrep symlink
  
  MFC r316473: bsdgrep: treat rgrep as grep -r
  
  MFC r316484: bsdgrep(1): create rgrep link
  
  Create a convenience rgrep link for bsdgrep(1) that observes 'grep -r'
  behavior.
  
  A follow-up to r316473.
  
  Approved by:	emaste (mentor)

Modified:
  stable/11/usr.bin/grep/Makefile
  stable/11/usr.bin/grep/grep.1
  stable/11/usr.bin/grep/grep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/grep/Makefile
==============================================================================
--- stable/11/usr.bin/grep/Makefile	Tue Aug 15 00:54:16 2017	(r322524)
+++ stable/11/usr.bin/grep/Makefile	Tue Aug 15 01:22:39 2017	(r322525)
@@ -25,12 +25,14 @@ CFLAGS.gcc+= --param max-inline-insns-single=500
 .if ${MK_BSD_GREP} == "yes"
 LINKS=	${BINDIR}/grep ${BINDIR}/egrep \
 	${BINDIR}/grep ${BINDIR}/fgrep \
+	${BINDIR}/grep ${BINDIR}/rgrep \
 	${BINDIR}/grep ${BINDIR}/zgrep \
 	${BINDIR}/grep ${BINDIR}/zegrep \
 	${BINDIR}/grep ${BINDIR}/zfgrep
 
 MLINKS= grep.1 egrep.1 \
 	grep.1 fgrep.1 \
+	grep.1 rgrep.1 \
 	grep.1 zgrep.1 \
 	grep.1 zegrep.1 \
 	grep.1 zfgrep.1

Modified: stable/11/usr.bin/grep/grep.1
==============================================================================
--- stable/11/usr.bin/grep/grep.1	Tue Aug 15 00:54:16 2017	(r322524)
+++ stable/11/usr.bin/grep/grep.1	Tue Aug 15 01:22:39 2017	(r322525)
@@ -34,7 +34,7 @@
 .Dt GREP 1
 .Os
 .Sh NAME
-.Nm grep , egrep , fgrep ,
+.Nm grep , egrep , fgrep , rgrep ,
 .Nm zgrep , zegrep , zfgrep
 .Nd file pattern searcher
 .Sh SYNOPSIS
@@ -341,6 +341,10 @@ will only search a file until a match has been found,
 making searches potentially less expensive.
 .It Fl R , Fl r , Fl Fl recursive
 Recursively search subdirectories listed.
+(i.e. force
+.Nm grep
+to behave as
+.Nm rgrep ) .
 .It Fl S
 If
 .Fl R

Modified: stable/11/usr.bin/grep/grep.c
==============================================================================
--- stable/11/usr.bin/grep/grep.c	Tue Aug 15 00:54:16 2017	(r322524)
+++ stable/11/usr.bin/grep/grep.c	Tue Aug 15 01:22:39 2017	(r322525)
@@ -361,6 +361,9 @@ main(int argc, char *argv[])
 	} else if (pn[0] == 'l' && pn[1] == 'z') {
 		filebehave = FILE_LZMA;
 		pn += 2;
+	} else if (pn[0] == 'r') {
+		dirbehave = DIR_RECURSE;
+		Hflag = true;
 	} else if (pn[0] == 'z') {
 		filebehave = FILE_GZIP;
 		pn += 1;



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