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

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

unix.superglobalmegacorp.com

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