script to output overlap/touching info + percentages from an input shapefil

output looks like:
1 115281 TOUCHES 0.0143163614058
1 115148 CONTAINS 1.0
1 115328 CONTAINS 1.0
1 115108 CONTAINS 1.0
1 114881 CONTAINS 1.0
1 114798 CONTAINS 1.0
1 115010 TOUCHES 0.0235229991346
1 114607 CONTAINS 1.0
1 115230 CONTAINS 1.0
1 114949 CONTAINS 1.0
1 114897 CONTAINS 1.0
1 114964 CONTAINS 1.0
1 114926 CONTAINS 1.0
1 115065 CONTAINS 1.0