I want everything else to remain identical, only have uppercase letters come first.
Asked
Active
Viewed 1,569 times
1 Answers
7
This may be mostly a locale issue. If you don't need anything specific to your locale (and want your script to work the same on different systems), you may reset LC_COLLATE
like this:
$ echo -e "foo\nFoo" | LC_COLLATE=C sort
Foo
foo
You may also set LC_COLLATE
for the whole life-time of your script if you don't need any locale-specific collations anywhere:
export LC_COLLATE=C

Michał Górny
- 18,713
- 5
- 53
- 76