4.10. Fixed grep (grep -F and fgrep)

 <  Day Day Up  >  

4.10. Fixed grep ( grep “F and fgrep )

The fgrep command behaves like grep , but does not recognize any regular expression metacharacters as being special. All characters represent only themselves . A caret is simply a caret, a dollar sign is a dollar sign, and so forth. With the “F option, GNU grep behaves exactly the same as fgrep .

Example 4.51.
 %  fgrep '[A-Z]****[0-9]...00' file   or  %  grep -F '[A-Z]****[0-9]...00' file  

EXPLANATION

Finds all lines in the file containing the literal string [A “Z]****[0 “9]..$5.00 . All characters are treated as themselves. There are no special characters.

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net