Lại Phương Thanh
New member
How do I sort an array in Linux?
Answer
Answer
- Copy the array to the positional arguments. …
- Then sort does its thing.
- Read the stream into an array with mapfile (e.g. mapfile -t array reads each line into the variable array and the -t ignores the n in each line).
- Dump the array to show its been sorted.