

Specify one or more patterns to be used during the search for input. c Write only a count of selected lines to standard output. If an input line containsĪny of the patterns as a contiguous sequence of bytes, the line shall be matched.

Treat each pattern specified as a string instead of a regular expression. If any entire ERE pattern matches some part of an input line excluding the terminating, the line shall be matched.Ī null ERE shall match every line. Of IEEE Std 1003.1-2001, Section 9.4, Extended Regular Expressions. Treat each pattern specified as an ERE, as described in the Base Definitions volume The following options shall be supported: -E Match using extended regular expressions. The grep utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines. Similarly, since patterns are matchedĪgainst individual lines (excluding the terminating s) of the input, there is no way for a pattern to match a e and -f options below), regular expressions cannot contain a.

Since a separates or terminates patterns (see the Regular expression matching shall be based on text lines. Selected input line shall be written to the standard output. Matches any part of the line excluding the terminating a null BRE shall match every line. Of IEEE Std 1003.1-2001, Section 9.3, Basic Regular Expressions, Shall be selected if any pattern, treated as an entire basic regular expression (BRE) as described in the Base Definitions volume The pattern_file's contents shall consist of one or more patterns terminated by. The pattern_list's value shall consist of one or more patterns separated by s The patterns are specified by the -e option, -f option, or the The grep utility shall search the input files, selecting lines matching one or more patterns the types of patterns areĬontrolled by the options specified. NAME grep - search a file for a pattern SYNOPSIS A newer edition of this document exists here Grep The Open Group Base Specifications Issue 6Ĭopyright © 2001-2004 The IEEE and The Open Group, All Rights reserved.
