diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-07 23:13:44 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-07 23:13:44 +0800 |
commit | ae31e19f92e717919ac8e3db9039eb38d2b89aae (patch) | |
tree | c70164d6a1852344f44b04a653ae2815043512af /util/kenben.c | |
download | pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.gz pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.bz2 pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.lz pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.xz pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.zst pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.zip |
Initial revision
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/kenben.c')
-rw-r--r-- | util/kenben.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/util/kenben.c b/util/kenben.c new file mode 100644 index 00000000..5733f4da --- /dev/null +++ b/util/kenben.c @@ -0,0 +1,44 @@ +#include <stdio.h> + + +void main() +{ + FILE * fin, * fout; + char line[255], line2[255]; + int i; + char genbuf[255], tok[20]; + fin = fopen("M.1006277896.A","r"); + while(!feof(fin)) + { + fgets(line,255,fin); + line[12] = '\0'; + + sprintf(genbuf, "cd ~/boards/%s;grep " + "超過一個月無廣告以外的本站文章發表。" + " *.A > ~/pttbbs/util/kenken.txt",line); + system(genbuf); + + fout = fopen("kenken.txt","r"); + while(!feof(fout)) + { + line2[0] = '\0'; + fgets(line2,255,fout); + if(strlen(line2) <= 10) break; + sscanf(line2,"%s:",tok); + for(i = 0; i < 20;i++) + { + if(tok[i] == ':') + { + tok[i] = '\0'; + break; + } + } + sprintf(genbuf, "cd ~/boards/%s;rm %s",line, tok); +// printf("%s \n", genbuf); + system(genbuf); + } + } + + fclose(fin); + +} |