Here\'s my array (gawk script) :
myArray[\"peter\"] = 32
myArray[\"bob\"] = 5
myArray[\"john\"] = 463
myArray[\"jack\"] = 11
After sort, I
The authors of The Awk Programming Language provide a quicksort function, which is available online.
I think you'd do something like this.
END {
for (key in myArray) {
sortkeys[j++] = key;
}
qsort(sortkeys, 0, length(myArray)); # Not sure I got the args right.
for (i = 1; i <= length(myArray); i++) {
print sortkeys[i], myArray[sortkeys[i]];
}
}