summaryrefslogtreecommitdiffstats
path: root/cdbmake-sv.sh
blob: 241d46c9ebd01660668848ea04fe7f16eec995cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 "$@"