How a sort associative array bash script
问题 How do I sort an associative array in bash? For example, I have array in bash: [0,0]="Max" [0,1]="25" [1,0]="Vladimir" [1,1]="0" [2,0]="Mayki" [2,1]="50" Output must be: Mayki - 50 Max - 25 Vladimir - 0 I don't know how sort this array. Additional Info: I parse assoc array from text file ("log.txt") #!/bin/bash declare -A b_array # Read the file in parameter and fill the array named "array" getArray() { i=0 w=9 count=10 while read line # Read a line do k=0 #array[i]=$line # Put it into the