I would like to use sort
to sort by ASCII value, or at least by not disregarding punctuation, i.e:
sort <<DATA
a.01
a.04
a2
a.3
a.2
DATA
Should produce
a.01
a.04
a.2
a.3
a2
Especially these properties are important:
- Dots are not ignored, so
a.2 < a.3 < a2
- Numbers are not treated specially, so
a.04 < a.3
How do I achieve this?
LC_COLLATE=C sort …
should do what you want. – Kamil Maciorowski Sep 28 '21 at 17:58