There are 2 programs in here.... Here is a program to convert your hosts.net to domain.txt: ============ CUT HERE ================= #include #include #include #define LINELEN 256 /* copyright 1989 - John D. Hays, KD7UW */ main(int argc,char *argv[]) { FILE *fi,*fo; char string[LINELEN-1]; char addr[20],hname1[80],hname2[80]; char *x,*y,*z; int cnt; fprintf(stderr,"COPYRIGHT 1989 - John D. Hays, KD7UW\n"); if (argc != 3) { fprintf(stderr,"Usage: %s input-hosts.net output-domain.txt\n\007", argv[0]); exit(0); } if ((fi=fopen(argv[1],"r")) != NULL) { fo = fopen(argv[2],"w"); while (fgets(string,LINELEN,fi) != NULL) { y = strchr(string,'\n'); *y = '\0'; addr[0] = '\0'; hname1[0] = '\0'; hname2[0] = '\0'; if ((string[0] == '#') || (strlen(string) < 3)) { fprintf(fo,"%s\n",string); goto foo; } y = strchr(string,'#'); if (y != NULL) { fprintf(fo,"#%s\n",y); *y = '\0'; } sscanf(string,"%s%s%s",addr,hname1,hname2); if (strchr(hname1,'.')) { x = hname1; z = hname2; } else { x = hname2; z = hname1; } if ((*x == '\0') || (*z == '\0')) { fprintf(fo,"%s.\tIN\tA\t%s\n",hname1,addr); } else { fprintf(fo,"%s.\tIN\tA\t%s\n",x,addr); fprintf(fo,"%s.\tIN\tCNAME\t%s.\n",z,x); } foo: fprintf(stderr,"%s\n",string); } } } ============ CUT HERE ================= This program allows you to push mail destined for one host to another (i.e. going on vacation and shutting down your host but want your mail delivered by your "buddy"): ============ CUT HERE ================= #include #include #include #include #include #define MAXLINE 256 main(int argc,char *argv[]) { struct ffblk block; int done,i; FILE *fd,*fo; char *j,str[MAXLINE+2],*strp; fprintf(stderr,"\n%s is COPYRIGHT 1989 by John D. Hays (KD7UW)\n",argv[0]); fprintf(stderr,"Authorized for unlimited distribution for "); fprintf(stderr,"Amateur Radio Use\n"); fprintf(stderr,"This notice must be retained. All Rights Reserved.\n\n"); if (argc < 3) { fprintf(stderr,"Usage: %s oldhost forwardhost \007\n",argv[0]); exit(0); } done = findfirst("*.wrk",&block,0x3F); while (!done) { if ((fd = fopen(block.ff_name,"r")) != NULL) strp = str; /* Turbo-C is not handling fgets right ??? */ { strp = fgets(strp,MAXLINE,fd); j = strrchr(strp,'\n'); if (j != NULL) *j = '\0'; if (stricmp(argv[1],strp) == 0) { fprintf(stderr,"Changing: %s\n",block.ff_name); i = unlink(block.ff_name); fo = fopen(block.ff_name,"w"); fprintf(fo,"%s\n",argv[2]); while ((strp = fgets(strp,MAXLINE,fd)) != NULL) { fprintf(fo,"%s",strp); } } fclose(fd); fclose(fo); } fprintf("%s: Unable to open %s\n",argv[0],block.ff_name); done = findnext(&block); } } ============ CUT HERE ================= Hope these help those of you who are bringing up NOS. John D. Hays KD7UW hays@apollo.hp.com