In bash, there is an array like this:
arr=(12345_34, 5_32134, 8_123, 13_1234)
And I'd like to sort (decreasing order) this array based on the numbers before the underscore. So the desired result is the following:
(12345_34, 13_1234, 8_123, 5_32134)
I tried sort -t _-k 2 -g $arr