This question already has an answer here:
- How to sort an array in Bash 15 answers
For instance, the array is
link2_pathname
link1_pathname
link3_pathname
How can I get the array like below.
link1_pathname
link2_pathname
link3_pathname
Thanks a lot in advance!
try this
pipe a loop to
sort
.you probably need to watch out for the IFS when handling string values containing spaces.