[HECnet] Quick and nasty conversion of nodenames.dat for /etc/decnet.conf

Tony Blews tonyblews at gmail.com
Thu Jul 11 03:35:37 PDT 2013


So, I got bored, and bashed this thing together:
  
#include <stdio.h>   #include <string.h>
int main(void)   {          char line[128];          char *nodenum, *nodename;          int i;          while (gets(line)!=NULL)          {              if (line[0] !=        )              {                  nodenum = strtok (line,     \n   );                  nodename = strtok (NULL,     \n   );                  for(i = 0; nodename[i]; i++)                  {                      nodename[i] = tolower(nodename[i]);                  }                  printf(   node\t\t%s\t\tname\t\t%s\n   ,nodenum,nodename);              }          }   }
So on the linux box:
# gcc -o mkhecnodes mkhecnodes.c
# dncopy 1.13::nodenames.dat nodenames.dat
# ./mkhecnodes <nodenames.dat >> /etc/decnet.conf
It works for me.
  
Tony.
  



More information about the Hecnet-list mailing list