RosettaCodeData/Task/Sort-an-integer-array/UNIX-Shell/sort-an-integer-array-1.sh

4 lines
89 B
Bash
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
nums="2 4 3 1 5"
sorted=`printf "%s\n" $nums | sort -n`
echo $sorted # prints 1 2 3 4 5