Given for example the class of “visible characters”
[:graph:]
AKA
[\x21-\x7E]
How could I go about printing those in “collation” order, that is the order determined by LC_COLLATE
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just run it through sort. The hardest part is getting a list of characters. This works for ASCII:
It writes out each character followed by a NUL byte, then sorts them all (
sortconsiders LC_COLLATE), and finally deletes the NULs.