Answers for "how to sort array in shell script"

1

how to sort array in shell script

# sorts array arr and stores it in array arrSorted in ascending order
# %d for integers
# %f for floats
readarray -t arrSorted < <(printf '%d\n' "${arr[@]}" | sort)
Posted by: Guest on June-01-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language