Annotation of researchv10no/ipc/mgrs/ns/mkdb/parsehosts.sh, revision 1.1

1.1     ! root        1: echo Process $* 1>&2
        !             2: cat $* | awk '
        !             3: #
        !             4: #      Parse hosts file.  Output format is
        !             5: #              <uid> INET,<number> <name> <name> ...
        !             6: #      merge entries with equivalent internet numbers
        !             7: #
        !             8: 
        !             9: BEGIN {
        !            10:        notinet = "[^0-9.]";
        !            11: }
        !            12: #
        !            13: #      ignore blank and comment lines
        !            14: #
        !            15: $0 ~ /^#/      {next;}
        !            16: NF>1 {
        !            17: #      
        !            18: #      check that internet address has only digits and '.'s
        !            19: #
        !            20:        if(match($1,notinet)) {
        !            21:                print "Line " NR ": Illegal internet address " $1 | "cat 1>&2"
        !            22:                next;
        !            23: 
        !            24:        }
        !            25: #
        !            26: #      label domains 
        !            27: #
        !            28:        line = "INET," $1;
        !            29:        for (i=2; i<=NF; i++)
        !            30:                if(match($i, ".com")){
        !            31:                        line = line " DOMAIN," $i
        !            32:                } else
        !            33:                        line = line " " $i
        !            34: #
        !            35: #      output the line with an id #
        !            36: #
        !            37:        print line
        !            38: }
        !            39: '

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.