home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 164_01 / fgrep.doc < prev    next >
Text File  |  1984-09-03  |  3KB  |  94 lines

  1.  
  2.  
  3.        FGREP        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  4.  
  5.  
  6.  
  7.  
  8.        FGREP ---
  9.  
  10.  
  11.        The  FGREP utility searches files for particular     text  patterns.
  12.        Each  line on which the pattern is found    is displayed.    The text
  13.        patterns    cannot contain blanks or any wild-cards.  The syntax is:
  14.  
  15.  
  16.        FGREP <options> <pattern> <files    or directories>
  17.  
  18.  
  19.        The values for <options>    are as follows:
  20.  
  21.        -r     recursively   search  sub-directories    of   directories
  22.          specified  in    the list <files     or  directories>.   The
  23.          default  is  to  search  only files in     the  <files  or
  24.          directories>  list  and files in  directories    in  that
  25.          list.
  26.  
  27.        -i     ignore    upper/lower case when matching the <pattern>.
  28.  
  29.        -l     also print line numbers for matching text in files.
  30.  
  31.        -n     only print file names of files    with matching text.
  32.  
  33.        -v     reverse  the test--print all lines except those with  a
  34.          matching text pattern.
  35.  
  36.        -c     only  print a count of    how many lines contain    matching
  37.          text.
  38.  
  39.        -^     Treat the character ^ in the pattern string as    a blank.
  40.          Normally,  the     pattern cannot    contain    a blank     because
  41.          command line arguments    are separated by blanks.  The -^
  42.          option     is provided so    that a blank can effectively  be
  43.          specified in the pattern.  For    example,
  44.  
  45.          fgrep    -^  a^string *.pas
  46.  
  47.          searches  all    files ending in    .pas for the  string  "a
  48.          string".   Without the    -^ option, the string "a^string"
  49.          would be searched for.
  50.  
  51.        The <pattern> parameter is the text string to search  for.   This
  52.        string  is  specified  exactly as you want it to     appear     in  the
  53.        files'  lines  (that is,     it is not surrounded by  quotes).   The
  54.        pattern may contain no blanks, and cannot start with a '-' (which
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.        FGREP        UNIX like Utilities    for MS-DOS 2.0       Page-  2
  70.  
  71.  
  72.  
  73.  
  74.        is used to specify options).
  75.  
  76.        The  <files or directories> parameter is    identical to  SEARCH,  see
  77.        above.    If no files are    given, then FGREP accepts keyboard input
  78.        (or redirected input) to    search.
  79.  
  80.        Examples:
  81.  
  82.        FGREP -i    proc c:/sources    d:/project/*.asm
  83.         will  (ignoring upper/lower    case) print a list of files  and
  84.        their  lines  which  contain the     string     'proc',  files     in  the
  85.        directory  c:/sources,  and  files with an .ASM extension in  the
  86.        d:/project directory will be searched.
  87.  
  88.        FGREP -ri proc c:/sources d:/project/*.asm
  89.         will  act  as  the    above  example,     except     that  any  sub-
  90.        directories  of c:/sources (and their sub-directories) will  also
  91.        participate in the string search.
  92.  
  93.  
  94.