END { print "" o(rhscnt,"rhscnt") print "" o(rhslist,"rhslist") print "" o(lhs,"lhs") } function o(a, str,control, i,com) { str = str ? str : "array" if (control ~ /^[0-9]/) { if (control==0) o1(a,str) else for(i=1;i<=control;i++) print oprim(str,i,a) } else if (0 in a) # sometimes i store array size in a[0] o(a,str,a[0]) else { com = control ? control : " -n -k 2" com = "sort " com " #" rand(); # ensure com is unique for(i in a) print oprim(str,i,a) | com; close(com); } } function oprim(str,i,a, j) { j=i gsub(SUBSEP,",",j) return str "[ " j " ]\t=\t [ " a[i] " ]" }