diff options
author | Gabor Kovesdan <gabor@FreeBSD.org> | 2010-07-29 00:11:14 +0000 |
---|---|---|
committer | Gabor Kovesdan <gabor@FreeBSD.org> | 2010-07-29 00:11:14 +0000 |
commit | 55e44f511ddc3d5684f5c06220101eba4166ff55 (patch) | |
tree | 1e1d5961f5ee38199f4b4fbd83cfffc86339e1c5 /usr.bin/grep/grep.1 | |
parent | a955c461ad58ebfe59bfbd8da78f5625f76d783f (diff) | |
download | src-55e44f511ddc3d5684f5c06220101eba4166ff55.tar.gz src-55e44f511ddc3d5684f5c06220101eba4166ff55.zip |
- Use the traditional behaviour for filename and directory name inclusion
and exclusion patterns [1]
- Some improvements on the exiting code, like replacing memcpy with
strlcpy/strcpy
Approved by: delphij (mentor)
Pointed out by: bf [1], des [1]
Notes
Notes:
svn path=/head/; revision=210578
Diffstat (limited to 'usr.bin/grep/grep.1')
-rw-r--r-- | usr.bin/grep/grep.1 | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index 1f96a3eca5e1..38f96396f277 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -29,7 +29,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd September 19, 2009 +.Dd July 28, 2010 .Dt GREP 1 .Os .Sh NAME @@ -186,15 +186,31 @@ options are used to specify multiple patterns, or when a pattern begins with a dash .Pq Sq - . .It Fl Fl exclude -If -.Fl R -is specified, it excludes files matching the given -filename pattern. +If specified, it excludes files matching the given +filename pattern from the search. +Note that +.Fl Fl exclude +patterns take priority over +.Fl Fl include +patterns, and if no +.Fl Fl include +pattern is specified, all files are searched that are +not excluded. +Patterns are matched to the full path specified, +not only to the filename component. .It Fl Fl exclude-dir If .Fl R is specified, it excludes directories matching the -given filename pattern. +given filename pattern from the search. +Note that +.Fl Fl exclude-dir +patterns take priority over +.Fl Fl include-dir +patterns, and if no +.Fl Fl include-dir +pattern is specified, all directories are searched that are +not excluded. .It Fl F , Fl Fl fixed-strings Interpret .Ar pattern @@ -238,15 +254,25 @@ By default, .Nm grep is case sensitive. .It Fl Fl include -If -.Fl R -is specified, it includes the files matching the -given filename pattern. +If specified, only files matching the +given filename pattern are searched. +Note that +.Fl Fl exclude +patterns take priority over +.Fl Fl include +patterns. +Patterns are matched to the full path specified, +not only to the filename component. .It Fl Fl include-dir If .Fl R -is specified, it includes the directories matching the -given filename pattern. +is specified, only directories matching the +given filename pattern are searched. +Note that +.Fl Fl exclude-dir +patterns take priority over +.Fl Fl include-dir +patterns. .It Fl J, Fl Fl bz2decompress Decompress the .Xr bzip2 1 |