How to sort Integer Array in ksh | Unix Shell Scripting

前端 未结 1 1175
清歌不尽
清歌不尽 2021-01-25 23:26

How to sort integer array in KornShell. Found this link, KornShell Sort Array of Integers but it seems to be not working and throwing error.

Code:

NUM_A         


        
相关标签:
1条回答
  • 2021-01-25 23:41

    You can use sort with process substitution:

    sort -n <(printf "%s\n" "${NUM_ARR[@]}")
    
    0 讨论(0)
提交回复
热议问题