I want to sort an array of numbers and put into another array. The following code is what I found
IFS=$'\n' sorted=($(sort <<<"${array[*]}"))
unset IFS
echo "${sorted[*]}"
However, this does so by string
1 12 5 111 200 1000 10
1 10 1000 111 12 200 5
How do I get it sorted by number?
sort -n