BlastHardcheese 1339302799 learn keysort(){ unset b;local i j k n=0;for k in "${!a[@]}";do for((i=0;i${a[$k]}));then for((j=n;j>i;j--));do b[j]=${b[j-1]};done;break;fi;done;b[i]=$k;((n++));done;}# copies the keys of associative array a into b, sorted by the keys' corresponding values