Using bash I would like to sort a list of text strings in accordance with a first and a second order criteria:
- Number of characters in the text string; string with fewest characters first
- In order of the Danish alphabet which is the same as the English except for the letters
æ
,ø
,å
in the end (afterz
)
Example:
I would like this list:
aabb
ccc
aaaa
ddd
dgg
øøøø
aa
cc
ab
To be sorted into this:
aa
ab
cc
ccc
ddd
dgg
aaaa
aabb
øøøø
How can that be achieved?