#include #include void main(int argc, char *argv[]) { FILE *f, *g; char buf[8192], *p, *q, *match; int a, b, offset, len, count=0, total, found, matchlen; memset(buf, 0, 8192); if(argc < 3) { fprintf(stderr, "Usage: %s [pattern] [file...]\n", argv[0]); exit(1); } if(!(matchlen=strlen(argv[1]))) { fprintf(stderr, "%s: Invalid match length.\n", argv[0]); exit(1); } match=argv[1]; for(a=2;a