Skip to content

Instantly share code, notes, and snippets.

@doekman
Last active January 2, 2019 21:55
Show Gist options
  • Save doekman/4f266ccfe9cb0d300e00ca73ef6cddf4 to your computer and use it in GitHub Desktop.
Save doekman/4f266ccfe9cb0d300e00ca73ef6cddf4 to your computer and use it in GitHub Desktop.
Command-line program that sorts standard input as a human would expect.
# Rewrite from python ;-)
alias human_sort="sort --version-sort --ignore-case"
Line 1
Line 2
Line 12
24 lines in this example
Line 3
Line 11
Row 12 column 1
Line 5
Row 12 column 2
Row 1 column 1
These lines are sorted as expected
Line 6
Chapter 1.1
Line 9
Chapter 2.2.3
Chapter 2.2.04
Chapter 2.1
Chapter 2
Chapter 1.3
Line 7
Line 4
Good examples are rare
Line 10
Line 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment