Annotation of researchv10dc/vol2/index/tools/str.awk, revision 1.1

1.1     ! root        1: awk '
        !             2: /^\.(ig|de)/   {
        !             3:        print $0
        !             4:        while(getline && $0 !~ /^\.\./)
        !             5:                print $0
        !             6:        print $0
        !             7:        next
        !             8:        }
        !             9: /^\.ds/        {
        !            10:        print $0
        !            11:        if($0 ~ /\&/)gsub(/\&/,"\\\\&")
        !            12:        if($0 ~ /\\\"/)sub(/\\\".*/,"")
        !            13:        if(length($1) >3){
        !            14:                name=substr($1,4,length($1)-3)
        !            15:                start=2
        !            16:        }
        !            17:        else{ name=$2
        !            18:                start=3
        !            19:        }
        !            20:        if(length(name) == 1){
        !            21:                pat1[name]=$start
        !            22:                if(NF > start)
        !            23:                        for(i=start+1;i<=NF;i++)
        !            24:                                pat1[name]=pat1[name] " " $i
        !            25:        }
        !            26:        else{
        !            27:                if(name ~ /\(/)sub(/\(/,"\\\(",name)
        !            28:                pat2[name]=$start
        !            29:                if(NF > start)
        !            30:                        for(i=start+1;i<=NF;i++)
        !            31:                                pat2[name]=pat2[name] " " $i
        !            32:        }
        !            33:        next
        !            34:        }
        !            35: $0 ~ /\\\*/    {
        !            36:        gsub(/\\\*\(/,"foo2")
        !            37:        gsub(/\\\*/,"foo1")
        !            38:        if($0 ~ "foo2")
        !            39:                for(i in pat2){
        !            40:                        str="foo2" i
        !            41:                        if($0 ~ str){
        !            42:                                gsub(str,pat2[i])
        !            43:                        }
        !            44:                }
        !            45:        if($0 ~ /foo/){
        !            46:                for(i in pat1){
        !            47:                        str="foo1" i
        !            48:                        if($0 ~ str){
        !            49:                                gsub(str,pat1[i])
        !            50:                        }
        !            51:                }
        !            52:        }
        !            53:        print $0
        !            54:        next
        !            55: }
        !            56: /.*/   {print $0}
        !            57: ' $1

unix.superglobalmegacorp.com

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