I have several lines in file, just like below:
/adbc/eee/ddd/baa/ /adbc/fff/ddd/ccc/avfff/ /adbc/ccc/ddd/b/ /adbc/fff/ddd/c/ /adbc/ccc/ddd/bf/ /adbc/ccc/ddd/bc/ The sort algorithm must first get the string before last /, that is:
baa avfff b c bf bc and then sort it by the first character, and then the length of the string, and then alphabetically.
The expected result is
/adbc/fff/ddd/ccc/avfff/ /adbc/ccc/ddd/b/ /adbc/ccc/ddd/bc/ /adbc/ccc/ddd/bf/ /adbc/eee/ddd/baa/ /adbc/fff/ddd/c/
bash. Surprisingly enough, you sort withsort:-)