I have an array that have the CPU core num and a number for each core. the array is totals.
How can I sort
totals=( CPU0=12345 CPU1=23456 CPU3=01234)
according to numbers and return the sorted version of cpu number for example (3,0,1) means it is sorted and core 3 is the min and core 1 is the max, in bash? and then assign (3,0,1) to an array?