in reply to How to sort in this upper / lower case?

Many locales (but not the default C locale) sort this way, so if you use locale; then cmp or sort will do what you want. For example:

[am]king ~$ LC_COLLATE=hu_HU perl -we 'use locale; print join(" ", sor +t(qw"ABU gubu abu GUBU babu Babu bubu")), "\n";' abu ABU babu Babu bubu gubu GUBU [am]king ~$ LC_COLLATE=hu_HU perl -we 'print join(" ", sort(qw"ABU gub +u abu GUBU babu Babu bubu")), "\n";' ABU Babu GUBU abu babu bubu gubu