view cdbmake-sv.sh @ 0:2cb46628feec

from cdb-0.75 per http://cr.yp.to/cdb.html, retrieved 2025-01-03, contents appear to have been create on 2000-02-19
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 29 Jan 2025 10:50:34 +0000
parents
children
line wrap: on
line source

awk '
  {
    if (split($0,x,"#")) {
      f = split(x[1],y)
      if (f >= 2) {
        if (split(y[2],z,"/") >= 2) {
          a = "@" z[1] "/" z[2]
          print "+" length(a) "," length(y[1]) ":" a "->" y[1]
          for (i = 1;i <= f;i += 1) {
            if (i != 2) {
              a = y[i] "/" z[2]
              print "+" length(a) "," length(z[1]) ":" a "->" z[1]
            }
          }
        }
      }
    }
  }
  END {
    print ""
  }
' | HOME/bin/cdbmake "$@"