Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 1 1: # 2: /* 3: * grep. 4: */ 5: 6: /*)BUILD $(TKBOPTIONS) = { 7: TASK = ...GRE 8: } 9: */ 10: 11: #ifdef DOCUMENTATION 12: 13: title grep Get Regular Expression and Print 14: index Get Regular Expression and Print 15: 16: synopsis 17: 18: grep [options] regular_expression [ file ...] 19: 20: description 21: 22: Grep searches each specified file (if none are specified, it reads 23: stdin) for lines matching the given pattern. Grep allows wild-card 24: file names in the file list. The following options are recognized: 25: .lm +8 26: .s.i -4;-c Only print a count of matching lines. 27: .s.i -4;-f Print file name option, see below. 28: .s.i -4;-n Preceed each line by its line number. 29: .s.i -4;-v Print non-matching lines. 30: .s.lm -8 31: The file name is normally printed if more than one file argument is 32: given, or if a wild-card file name was specified. The "-f" flag 33: reverses this action (print name if one file, not if more). 34: .s 35: The regular_expression defines the pattern to search for. Upper- and 36: lower-case are not distinguished by grep. 37: Blank lines never match. The regular_expression 38: should be quoted. 39: .s 40: The regular_expression is built out of the following elements: 41: .lm +8 42: .s.i -6;x An ordinary character (not mentioned below) matches 43: that character. 44: .s.i -6;'_\' The backslash quotes any character. "_\$" matches 45: a dollar-sign. 46: .s.i -6;'_^' A circumflex at the beginning of an expression matches 47: the beginning of a line. 48: .s.i -6;'$' A dollar-sign at the end of an expression matches 49: the end of a line. 50: .s.i -6;'.' A period matches any character except "new-line". 51: .s.i -6;':a' A colon matches a class of characters##described 52: .i -6;':d' by##the##following##character.##":a" matches any 53: .i -6;':n' alphabetic, ":d" matches##digits.##":n"##matches 54: .i -6;':#' alphanumerics, and ":#" matches spaces tabs, and 55: .br 56: other control characters, such as newline. 57: .s.i -6;'*' An expression followed by an asterisk matches zero Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 2 58: or more occurrances of that expression: "fo*" matches "f", "fo" 59: "foo", etc. 60: .s.i -6;'+' An expression followed by a plus sign matches one 61: or more occurrances of that expression: "fo+" matches "fo", etc. 62: .s.i -6;'-' An expression followed by a minus sign optionally 63: matches the expression. 64: .s.i -6;'[]' A string enclosed in square brackets matches any 65: character in that string, but no others. If the first character in the 66: string is a circumflex, the expression matches any character 67: except "new-line" and the characters in the string. 68: .s 69: For example, "A[xyz]+B" matches "AxxB" and "AxyzzyB", while "A[^xyz]+B" 70: matches "AbcB" but not "AxB". A range of characters may be 71: specified by two characters separated by "-". Note that 72: [a-z] matches alphabetics, while [z-a] never matches. 73: .s.lm -8 74: The concatenation of regular expressions is a regular expression. 75: 76: diagnostics 77: 78: .lm +8 79: .s.i -8;No arguments 80: .s.i -8;Unknown flag 81: .s.i -8;No pattern 82: .s.i -8;"file__name": cannot open 83: .s.i -8;Illegal occurrence operator ... 84: .s 85: An operator was found in an illegal context. For example, the pattern 86: "*foo" is illegal as the '*' operator must modify a previously 87: specified pattern element. 88: .s.i -8;No : type 89: .s 90: A colon was followed by an unknown modifier. 91: .s.i -8;Class terminates badly 92: .s 93: A character class "[...]" was incorrectly terminated. For example, 94: "[A-]" is incorrect. 95: .s.i -8;Unterminated class 96: .s 97: Character classes must be terminated by ']'. 98: .s.i -8;Class too large 99: .s 100: An internal buffer filled. 101: .s.i -8;Empty class 102: .s 103: A character class must designate something: "[]" is illegal. 104: .s.i -8;Pattern too complex 105: .s 106: An internal buffer filled. 107: .lm -8 108: 109: author 110: 111: David Conroy, Martin Minow. 112: 113: bugs 114: 115: #endif Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 3 116: 117: char *documentation[] = { 118: "grep searches a file for a given pattern. Execute by", 119: " grep [flags] regular_expression file_list", 120: "", 121: "Flags are single characters preceeded by '-':", 122: " -c Only a count of matching lines is printed", 123: " -f Print file name for matching lines switch, see below", 124: " -n Each line is preceeded by its line number", 125: " -v Only print non-matching lines", 126: "", 127: "On RSX, RT11, RSTS, input or output may be redirected:", 128: " grep ... file.out", 129: "The file_list is a list of files (wildcards are acceptable on RSX modes).", 130: "If no files are given, input comes from the terminal. There is no prompting.", 131: "The file name is normally printed if there is a file given.", 132: "The -f flag reverses this action (print name no file, not if more).", 133: "", 134: "The regular_expression defines the pattern to search for. Upper- and", 135: "lower-case are always ignored. Blank lines never match. The expression", 136: "should be quoted to prevent file-name translation.", 137: "x An ordinary character (not mentioned below) matches that character.", 138: "'\\' The backslash quotes any character. \"\\$\" matches a dollar-sign.", 139: "'^' A circumflex at the beginning of an expression matches the", 140: " beginning of a line.", 141: "'$' A dollar-sign at the end of an expression matches the end of", 142: " a line.", 143: "'.' A period matches any character except \"new-line\".", 144: "':a' A colon matches a class of characters described by the following", 145: "':d' character. \":a\" matches any alphabetic, \":d\" matches digits,", 146: "':n' \":n\" matches alphanumerics, \": \" matches spaces, tabs, and", 147: "': ' other control characters, such as new-line.", 148: "'*' An expression followed by an asterisk matches zero or more", 149: " occurrances of that expression: \"fo*\" matches \"f\", \"fo\"", 150: " \"foo\", etc.", 151: "'+' An expression followed by a plus sign matches one or more", 152: " occurrances of that expression: \"fo+\" matches \"fo\", etc.", 153: "'-' An expression followed by a minus sign optionally matches", 154: " the expression.", 155: "'[]' A string enclosed in square brackets matches any character in", 156: " that string, but no others. If the first character in the", 157: " string is a circumflex, the expression matches any character", 158: " except \"new-line\" and the characters in the string. For", 159: " example, \"[xyz]\" matches \"xx\" and \"zyx\", while \"[^xyz]\"", 160: " matches \"abc\" but not \"axb\". A range of characters may be", 161: " specified by two characters seperated by \"-\". Note that,", 162: " [a-z] matches alphabetics, while [z-a] never matches.", 163: "", 164: "The concatenation of regular expressions is a regular expression.", 165: "", 166: 0 }; 167: 168: #include 169: 170: #define LMAX 512 171: #define PMAX 256 172: 173: #define CHAR 1 Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 4 174: #define BOL 2 175: #define EOL 3 176: #define ANY 4 177: #define CLASS 5 178: #define NCLASS 6 179: #define STAR 7 180: #define PLUS 8 181: #define MINUS 9 182: #define ALPHA 10 183: #define DIGIT 11 184: #define NALPHA 12 185: #define PUNCT 13 186: #define RANGE 14 187: #define ENDPAT 15 188: 189: int cflag; 190: int fflag; 191: int nflag; 192: int vflag; 193: int nfile; 194: int debug = 0; /* Set for debug code */ 195: char *pp; 196: 197: char file_name[81]; 198: 199: char lbuf[LMAX]; 200: char pbuf[PMAX]; 201: 202: main(argc, argv) 203: char *argv[]; 204: { 205: register char *p; 206: register int c, i; 207: int gotpattern; 208: FILE *f; 209: int gotcha; 210: 211: if (argc <= 1) 212: usage("No arguments"); 213: if (argc == 2 && argv[1][0] == '?' && argv[1][1] == 0) { 214: help(); 215: return; 216: } 217: nfile = argc-1; 218: gotpattern = 0; 219: for (i=1; i < argc; ++i) { 220: p = argv[i]; 221: #ifdef vms 222: /* 223: * Hand-knit I/O redirection for vms 224: */ 225: if (*p == '<') { 226: freopen(&p[1], "r", stdin); 227: argv[i] = NULL; 228: continue; 229: } 230: if (*p == '>') { 231: if (p[1] == '>') Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 5 232: freopen(&p[2], "a", stdout); 233: else 234: freopen(&p[1], "w", stdout); 235: argv[i] = NULL; 236: continue; 237: } 238: #endif 239: if (*p == '-') { 240: ++p; 241: while (c = *p++) { 242: switch(lower(c)) { 243: 244: case '?': 245: help(); 246: break; 247: 248: case 'c': 249: ++cflag; 250: break; 251: 252: case 'd': 253: ++debug; 254: break; 255: 256: case 'f': 257: ++fflag; 258: break; 259: 260: case 'n': 261: ++nflag; 262: break; 263: 264: case 'v': 265: ++vflag; 266: break; 267: 268: default: 269: usage("Unknown flag"); 270: } 271: } 272: argv[i] = 0; 273: --nfile; 274: } else if (!gotpattern) { 275: compile(p); 276: argv[i] = 0; 277: ++gotpattern; 278: --nfile; 279: } 280: } 281: if (!gotpattern) 282: usage("No pattern"); 283: if (nfile == 0) 284: grep(stdin, 0); 285: else { 286: fflag = fflag ^ (nfile > 0); 287: for (i=1; i < argc; ++i) { 288: if ((p = argv[i]) != NULL) { 289: if ((f = fwild(p, "r")) == NULL) Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 6 290: cant(p); 291: else { 292: gotcha = 0; 293: while (fnext(f) != NULL) { 294: fgetname(f, file_name); 295: grep(f, file_name); 296: gotcha = 1; 297: } 298: if (!gotcha) 299: cant(p); 300: } 301: } 302: } 303: } 304: } 305: 306: file(s) 307: char *s; 308: { 309: printf("File %s:\n", s); 310: } 311: 312: cant(s) 313: char *s; 314: { 315: fprintf(stderr, "%s: cannot open\n", s); 316: } 317: 318: help() 319: /* 320: * Give good help 321: */ 322: { 323: register char **dp; 324: 325: for (dp = documentation; *dp; dp++) 326: printf("%s\n", *dp); 327: } 328: 329: usage(s) 330: char *s; 331: { 332: fprintf(stderr, "?GREP-E-%s\n", s); 333: fprintf(stderr, 334: "Usage: grep [-cfnv] pattern [file ...]. grep ? for help\n"); 335: exit(1); 336: } 337: Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 7 338: 339: 340: compile(source) 341: char *source; /* Pattern to compile */ 342: /* 343: * Compile the pattern into global pbuf[] 344: */ 345: { 346: register char *s; /* Source string pointer */ 347: register char *lp; /* Last pattern pointer */ 348: register int c; /* Current character */ 349: int o; /* Temp */ 350: char *spp; /* Save beginning of pattern */ 351: char *cclass(); /* Compile class routine */ 352: 353: s = source; 354: if (debug) 355: printf("Pattern = \"%s\"\n", s); 356: pp = pbuf; 357: while (c = *s++) { 358: /* 359: * STAR, PLUS and MINUS are special. 360: */ 361: if (c == '*' || c == '+' || c == '-') { 362: if (pp == pbuf || (o=pp[-1]) == BOL || 363: o == EOL || o == STAR || 364: o == PLUS || o == MINUS) 365: badpat("Illegal occurrance op.", source, s); 366: store(ENDPAT); 367: store(ENDPAT); 368: spp = pp; /* Save pattern end */ 369: while (--pp > lp) /* Move pattern down */ 370: *pp = pp[-1]; /* one byte */ 371: *pp = (c == '*') ? STAR : 372: (c == '-') ? MINUS : PLUS; 373: pp = spp; /* Restore pattern end */ 374: continue; 375: } 376: /* 377: * All the rest. 378: */ 379: lp = pp; /* Remember start */ 380: switch(c) { 381: 382: case '^': 383: store(BOL); 384: break; 385: 386: case '$': 387: store(EOL); 388: break; 389: 390: case '.': 391: store(ANY); 392: break; 393: 394: case '[': Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 8 395: s = cclass(source, s); 396: break; 397: 398: case ':': 399: if (*s) { 400: c = *s++; 401: switch(lower(c)) { 402: 403: case 'a': 404: store(ALPHA); 405: break; 406: 407: case 'd': 408: store(DIGIT); 409: break; 410: 411: case 'n': 412: store(NALPHA); 413: break; 414: 415: case ' ': 416: store(PUNCT); 417: break; 418: 419: default: 420: badpat("Unknown : type", source, s); 421: 422: } 423: break; 424: } 425: else badpat("No : type", source, s); 426: 427: case '\\': 428: if (*s) 429: c = *s++; 430: 431: default: 432: store(CHAR); 433: store(lower(c)); 434: } 435: } 436: store(ENDPAT); 437: store(0); /* Terminate string */ 438: if (debug) { 439: for (lp = pbuf; lp < pp;) { 440: if ((c = (*lp++ & 0377)) < ' ') 441: printf("\\%o ", c); 442: else printf("%c ", c); 443: } 444: printf("\n"); 445: } 446: } 447: 448: char * 449: cclass(source, src) 450: char *source; /* Pattern start -- for error msg. */ 451: char *src; /* Class start */ 452: /* Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 9 453: * Compile a class (within []) 454: */ 455: { 456: register char *s; /* Source pointer */ 457: register char *cp; /* Pattern start */ 458: register int c; /* Current character */ 459: int o; /* Temp */ 460: 461: s = src; 462: o = CLASS; 463: if (*s == '^') { 464: ++s; 465: o = NCLASS; 466: } 467: store(o); 468: cp = pp; 469: store(0); /* Byte count */ 470: while ((c = *s++) && c!=']') { 471: if (c == '\\') { /* Store quoted char */ 472: if ((c = *s++) == '\0') /* Gotta get something */ 473: badpat("Class terminates badly", source, s); 474: else store(lower(c)); 475: } 476: else if (c == '-' && 477: (pp - cp) > 1 && *s != ']' && *s != '\0') { 478: c = pp[-1]; /* Range start */ 479: pp[-1] = RANGE; /* Range signal */ 480: store(c); /* Re-store start */ 481: c = *s++; /* Get end char and */ 482: store(lower(c)); /* Store it */ 483: } 484: else { 485: store(lower(c)); /* Store normal char */ 486: } 487: } 488: if (c != ']') 489: badpat("Unterminated class", source, s); 490: if ((c = (pp - cp)) >= 256) 491: badpat("Class too large", source, s); 492: if (c == 0) 493: badpat("Empty class", source, s); 494: *cp = c; 495: return(s); 496: } 497: 498: store(op) 499: { 500: if (pp >= &pbuf[PMAX]) 501: error("Pattern too complex\n"); 502: *pp++ = op; 503: } 504: 505: lower(c) 506: register int c; 507: { 508: if (c>='A' && c<='Z') 509: c += 'a'-'A'; 510: return(c); Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 10 511: } 512: 513: badpat(message, source, stop) 514: char *message; /* Error message */ 515: char *source; /* Pattern start */ 516: char *stop; /* Pattern end */ 517: { 518: register int c; 519: 520: fprintf(stderr, "-GREP-E-%s, pattern is\"%s\"\n", message, source); 521: fprintf(stderr, "-GREP-E-Stopped at byte %d, '%c'\n", 522: stop-source, stop[-1]); 523: error("?GREP-E-Bad pattern\n"); 524: } 525: Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 11 526: 527: 528: grep(fp, fn) 529: FILE *fp; /* File to process */ 530: char *fn; /* File name (for -f option) */ 531: /* 532: * Scan the file for the pattern in pbuf[] 533: */ 534: { 535: register int lno, count, m; 536: 537: lno = 0; 538: count = 0; 539: while (fgetss(lbuf, sizeof lbuf, fp)) { 540: ++lno; 541: m = match(); 542: if ((m && !vflag) || (!m && vflag)) { 543: ++count; 544: if (!cflag) { 545: if (fflag && fn) { 546: file(fn); 547: fn = 0; 548: } 549: if (nflag) 550: printf("%d\t", lno); 551: printf("%s\n", lbuf); 552: } 553: } 554: } 555: if (cflag) { 556: if (fflag && fn) 557: file(fn); 558: printf("%d\n", count); 559: } 560: } 561: Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 12 562: 563: match() 564: /* 565: * Match the current line (in lbuf[]), return 1 if it does. 566: */ 567: { 568: register char *l; /* Line pointer */ 569: char *pmatch(); 570: 571: for (l = lbuf; *l; l++) { 572: if (pmatch(l, pbuf)) 573: return(1); 574: } 575: return(0); 576: } 577: 578: char * 579: pmatch(line, pattern) 580: char *line; /* (partial) line to match */ 581: char *pattern; /* (partial) pattern to match */ 582: { 583: register char *l; /* Current line pointer */ 584: register char *p; /* Current pattern pointer */ 585: register char c; /* Current character */ 586: char *e; /* End for STAR and PLUS match */ 587: int op; /* Pattern operation */ 588: int n; /* Class counter */ 589: char *are; /* Start of STAR match */ 590: 591: l = line; 592: if (debug > 1) 593: printf("pmatch(\"%s\")\n", line); 594: p = pattern; 595: while ((op = *p++) != ENDPAT) { 596: if (debug > 1) 597: printf("byte[%d] = 0%o, '%c', op = 0%o\n", 598: l-line, *l, *l, op); 599: switch(op) { 600: 601: case CHAR: 602: if (lower(*l++) != *p++) 603: return(0); 604: break; 605: 606: case BOL: 607: if (l != lbuf) 608: return(0); 609: break; 610: 611: case EOL: 612: if (*l != '\0') 613: return(0); 614: break; 615: 616: case ANY: 617: if (*l++ == '\0') 618: return(0); Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 13 619: break; 620: 621: case DIGIT: 622: if ((c = *l++) < '0' || (c > '9')) 623: return(0); 624: break; 625: 626: case ALPHA: 627: c = lower(*l++); 628: if (c < 'a' || c > 'z') 629: return(0); 630: break; 631: 632: case NALPHA: 633: c = lower(*l++); 634: if (c >= 'a' && c <= 'z') 635: break; 636: else if (c < '0' || c > '9') 637: return(0); 638: break; 639: 640: case PUNCT: 641: c = *l++; 642: if (c == 0 || c > ' ') 643: return(0); 644: break; 645: 646: case CLASS: 647: case NCLASS: 648: c = lower(*l++); 649: n = *p++ & 0377; 650: do { 651: if (*p == RANGE) { 652: p += 3; 653: n -= 2; 654: if (c >= p[-2] && c <= p[-1]) 655: break; 656: } 657: else if (c == *p++) 658: break; 659: } while (--n > 1); 660: if ((op == CLASS) == (n <= 1)) 661: return(0); 662: if (op == CLASS) 663: p += n - 2; 664: break; 665: 666: case MINUS: 667: e = pmatch(l, p); /* Look for a match */ 668: while (*p++ != ENDPAT); /* Skip over pattern */ 669: if (e) /* Got a match? */ 670: l = e; /* Yes, update string */ 671: break; /* Always succeeds */ 672: 673: case PLUS: /* One or more ... */ 674: if ((l = pmatch(l, p)) == 0) 675: return(0); /* Gotta have a match */ 676: case STAR: /* Zero or more ... */ Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 14 677: are = l; /* Remember line start */ 678: while (*l && (e = pmatch(l, p))) 679: l = e; /* Get longest match */ 680: while (*p++ != ENDPAT); /* Skip over pattern */ 681: while (l >= are) { /* Try to match rest */ 682: if (e = pmatch(l, p)) 683: return(e); 684: --l; /* Nope, try earlier */ 685: } 686: return(0); /* Nothing else worked */ 687: 688: default: 689: printf("Bad op code %d\n", op); 690: error("Cannot happen -- match\n"); 691: } 692: } 693: return(l); 694: } 695: Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 15 A 46 48 50 51 64 70 90 93 103 ALPHA 182 404 626 ANY 176 391 616 An 42 57 60 62 85 100 106 BOL 174 362 383 606 Blank 37 CHAR 173 432 601 CLASS 177 462 646 660 662 Characte 97 Class 91 98 Conroy 111 DIGIT 183 408 621 DOCUMENT 11 David 111 ENDPAT 187 366 367 436 595 668 680 EOL 175 363 387 611 Empty 101 Expressi 13 14 FILE 208 529 For 69 85 93 Get 13 14 Grep 22 23 If 65 Illegal 83 LMAX 170 199 MINUS 181 364 372 666 Martin 111 Minow 111 NALPHA 184 412 632 NCLASS 178 465 647 NULL 227 235 288 289 293 No 79 81 88 Note 71 Only 26 PLUS 180 364 372 673 PMAX 171 200 500 PUNCT 185 416 640 Pattern 104 Preceed 28 Print 13 14 27 29 RANGE 186 479 651 Regular 13 14 STAR 179 363 371 676 The 24 31 32 35 37 40 74 Unknown 80 Untermin 95 Upper 35 a 26 32 45 47 49 51 60 62 66 72 72 74 86 action 33 allows 23 alphabet 53 72 alphanum 54 an 46 48 57 85 90 and 13 14 35 54 54 67 69 any 50 52 64 66 are 22 24 36 589 677 681 argc 202 211 213 217 219 287 Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 16 argument 31 79 argv 202 203 213 213 220 227 235 272 276 288 as 56 86 asterisk 57 at 46 48 author 109 badly 91 badpat 365 420 425 473 489 491 493 513 be 38 70 97 beginnin 46 47 below 27 42 br 55 brackets 64 buffer 100 106 bugs 113 built 40 but 65 70 by 28 36 52 57 60 62 71 71 90 97 c 26 206 241 242 348 357 361 361 361 371 372 380 400 401 429 433 440 441 442 458 470 470 471 472 474 476 478 480 481 482 485 488 490 492 494 505 506 508 508 509 510 518 585 622 622 627 628 628 633 634 634 636 636 641 642 642 648 654 654 657 cannot 82 cant 290 299 312 card 23 32 cclass 351 395 449 cflag 189 249 544 555 characte 42 43 50 51 52 56 65 65 66 67 70 71 93 103 circumfl 46 66 class 51 93 95 101 103 classes 97 colon 51 90 compile 275 340 complex 104 concaten 74 context 85 control 56 count 26 535 538 543 558 cp 457 468 477 490 494 debug 194 253 354 438 592 596 define 170 171 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 defines 35 describe 51 descript 20 designat 103 diagnost 76 digits 53 distingu 36 document 117 325 dollar 45 48 dp 323 325 325 325 326 e 586 667 669 670 678 679 682 683 each 22 28 element 87 elements 40 enclosed 64 end 48 49 endif 115 238 error 501 523 690 Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 17 etc 59 61 example 69 85 93 except 50 67 exit 335 expressi 46 48 57 58 60 61 62 63 66 74 74 f 27 208 289 293 294 295 fflag 190 257 286 286 545 556 fgetname 294 fgetss 539 file 18 22 24 24 27 31 31 32 33 306 546 557 file_nam 197 294 295 filled 100 106 first 65 flag 32 80 fn 528 530 545 546 547 556 557 fnext 293 followed 57 60 62 90 followin 24 40 52 found 85 fp 528 529 539 fprintf 315 332 333 520 521 freopen 226 232 234 fwild 289 given 23 32 gotcha 209 292 296 298 gotpatte 207 218 274 277 281 grep 13 18 36 284 295 528 h 168 help 214 245 318 i 26 27 28 29 42 44 46 48 50 51 52 53 54 57 60 62 64 79 80 81 82 83 88 91 95 98 101 104 206 219 219 219 220 227 235 272 276 287 287 287 288 ifdef 11 221 illegal 85 86 103 in 24 64 65 65 67 85 include 168 incorrec 93 94 index 14 internal 100 106 is 31 31 40 66 74 86 94 103 it 22 its 28 l 568 571 571 571 572 583 591 598 598 598 602 607 612 617 622 627 633 641 648 667 670 674 674 677 678 678 679 681 682 684 693 large 98 lbuf 199 539 539 551 571 607 line 28 28 47 49 579 580 591 593 598 lines 23 26 29 37 list 24 lm 25 30 41 73 78 107 lno 535 537 540 550 lower 36 242 401 433 474 482 485 505 602 627 633 648 lp 347 369 379 439 439 440 m 535 541 542 542 main 202 match 37 541 563 matches 42 46 48 50 51 52 53 53 54 57 58 60 61 63 64 66 69 70 72 72 matching 23 26 29 may 70 Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 18 mentione 42 message 513 514 520 minus 62 modifier 90 modify 86 more 31 33 58 61 must 86 97 103 n 28 588 649 653 659 660 663 name 27 31 32 33 names 24 never 37 72 newline 56 nfile 193 217 273 278 283 286 nflag 191 261 549 no 65 non 29 none 22 normally 31 not 33 36 42 70 number 28 o 349 362 363 363 364 364 459 462 465 467 occurran 58 61 occurren 83 of 26 40 46 47 48 49 51 58 61 70 74 one 31 33 60 op 498 502 587 595 598 599 660 662 689 open 82 operator 83 85 86 option 27 optional 62 options 18 24 or 32 58 61 ordinary 42 other 56 others 65 out 40 p 205 220 225 226 230 231 232 234 239 240 241 275 288 289 290 299 584 594 595 602 649 651 652 654 654 657 663 667 668 674 678 680 682 pattern 23 35 81 85 87 579 581 594 pbuf 200 356 362 439 500 572 period 50 plus 60 pmatch 569 572 579 667 674 678 682 pp 195 356 362 362 368 369 370 370 371 373 379 439 468 477 478 479 490 500 502 previous 86 print 26 33 printed 31 printf 309 326 355 441 442 444 550 551 558 593 597 689 quoted 38 range 70 reads 22 recogniz 24 regular 74 74 regular_ 18 35 37 40 reverses 33 s 26 27 28 29 30 34 39 42 44 46 48 50 51 57 60 62 64 68 73 79 80 81 82 83 84 88 89 91 92 95 96 98 99 101 102 104 105 306 307 309 312 313 315 329 330 332 346 353 355 357 365 395 395 399 400 420 425 428 429 456 461 463 464 470 472 473 477 477 481 Cross Reference of: GREP.C;1 Mon May 12 13:36:42 1986 Page 19 489 491 493 495 search 35 searches 22 see 27 separate 71 should 38 sign 45 48 60 62 somethin 103 source 340 341 353 365 395 420 425 449 450 473 489 491 493 513 515 520 522 spaces 54 specifie 22 22 32 71 87 spp 350 368 373 square 64 src 449 451 461 stderr 315 332 333 520 521 stdin 23 226 284 stdio 168 stdout 232 234 stop 513 516 522 522 store 366 367 383 387 391 404 408 412 416 432 433 436 437 467 469 474 480 482 485 498 string 64 65 66 67 such 56 synopsis 16 tabs 54 terminat 91 93 97 than 31 that 43 58 61 65 71 the 23 24 35 40 46 47 48 49 52 63 65 65 66 67 67 85 86 this 33 title 13 to 35 too 98 104 two 71 type 88 unknown 90 usage 212 269 282 329 v 29 vflag 192 265 542 542 vms 221 was 32 85 90 93 wild 23 32 x 42 z 72 72 zero 57