Created
March 21, 2017 05:28
-
-
Save amosshapira/0ce4494c158dd717b85a5d6fb5d26a25 to your computer and use it in GitHub Desktop.
Sort on date field using GNU sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sample input: | |
# some-single-word 06/04/2011 03/04/2017 | |
# this will sort on the date field on the third column | |
# The main trick is the appending of "-n" at the end, for some reason this does it | |
gsort -b -k 3.7,3.10 -k 3.4,3.5 -k 3.1,3.2 -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment