(Jul-12-2019, 04:38 AM)Gribouillis Wrote: Wouldn't sort --version-sort
suit your needs?
for a lot uses, perhaps so. but versions is just one example. i illustrated with versions because it was a familiar example. i do have other cases that may or may not work with version handling programs, depending on how those programs extract or parse and deal with numbers. i just don't know what cases these features work with, so i pursue general solutions that i know will or should. for
sort --version-sort
the man page only describes it for versions.i remember implementing a general case compare function in 360/370 mainframe assembler language decades ago that worked character by character. it checked for decimal digits and counted how many there were to carry out the comparison as if the two numbers being compared were of equal length. Python posed an interesting difference since it used a function that was to return what was to be compared, unlike, for example, C's qsort() that takes a function that is to perform the actual comparison.
i just found that
sort --version-sort
changes the collating order of other characters like .
and _
which sort higher than alnums with that option. my method does not change the collating order.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.