HLGREP
Section: User Commands (1)
Updated: 2 Jun 1993
Index
Return to Main Contents
NAME
hlgrep - highlight grep
SYNOPSIS
hlgrep [ -aDhinw ]
pattern
[
filename ... ]
DESCRIPTION
hlgrep
searches the given
filenames
(or the standard input if no files are specified)
for lines containing the regular expression
pattern
and prints those lines with the matching patterns highlighted.
Regular expressions are the same as those used in
perl(1).
OPTIONS
- -a
-
Print all lines, not just those that contain matching patterns.
This is useful for seeing the patterns in context.
- -D
-
Print debugging info.
hlgrep
builds a command for perl to
eval.
This option causes that command to be printed to standard error before
any processing.
- -h
-
Don't print filenames when more than one file is given on the command line.
- -i
-
Ignore case.
- -n
-
Print line numbers.
- -w
-
Match patterns only as complete words.
Typical grep options like
-l
(print filenames only),
-c
(print count of matching lines only),
-s
(set exit status only), and
-v
(print lines that don't match) defeat the purpose of this program
(highlighting) and aren't provided. Use one of the other greps if
you need them.
NOTES
hlgrep
is written in perl, so your system must have perl installed. It uses
the package
getopts.pl,
which some versions of perl earlier than 4.036 don't have.
SEE ALSO
agrep(1),
egrep(1),
fgrep(1),
grep(1),
hgrep(1),
perl(1),
tput(1)
BUGS
The current version of
hlgrep
uses hardcoded values for terminal capability strings, but it can
be configured to use
tput(1)
to get terminal capabilities at runtime.
Please report any other bugs to the author.
DIAGNOSTICS
Exit status 0 if pattern found, 1 if pattern not found, 2 if syntax
error.
AUTHOR
Michael Fuhr (mfuhr@cwis.unomaha.edu, but probably not after
Summer '93).
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- NOTES
-
- SEE ALSO
-
- BUGS
-
- DIAGNOSTICS
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 06:46:43 GMT, December 12, 2024