RosettaCodeData/Task/Sort-an-integer-array/UNIX-Shell/sort-an-integer-array-2.sh
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

3 lines
112 B
Bash

set -A nums 2 4 3 1 5
set -A sorted $(printf "%s\n" ${nums[*]} | sort -n)
echo ${sorted[*]} # prints 1 2 3 4 5