Add a test case for a sorted array.
Use brackets instead of braces for sh.
Set IFS before sorting.