Bash associative array sorting by value
You can easily sort your output, in descending numerical order of the 3rd field: for k in “${!authors[@]}” do echo $k ‘ – ‘ ${authors[“$k”]} done | sort -rn -k3 See sort(1) for more about the sort command. This just sorts output lines; I don’t know of any way to sort an array directly in … Read more