DATESORT(LOCAL) DATESORT(LOCAL)
NAME
datesort - sort temporally by day and month names
SYNOPSIS
datesort [+x|-x...] [files]
DESCRIPTION
Datesort preprocesses input containing day-of-week (Sun,
Mon, Tue, ...) and month (Jan, Feb, Mar, ...) into
sortable fields. It then calls sort, passing along the
switch arguments (those beginning with "+" or "-") which
tell sort which fields to sort. Finally, the output of
sort is postprocessed to undo the preprocessing, so the
output looks like the input except it is sorted temporally
rather than alphabetically.
EXAMPLE
% datesort +4 -6 <<'EOF'
-rw-r--r-- 1 corey 3986 Feb 22 20:09 d24533
-rw-r--r-- 1 corey 4146 Mar 8 20:09 d24629
-rw-r--r-- 1 corey 3952 Feb 9 20:09 d25181
-rw-r--r-- 1 corey 3986 Feb 23 20:09 d26135
-rw-r--r-- 1 corey 4146 Mar 9 20:09 d26348
-rw-r--r-- 1 corey 3802 Jan 27 20:09 d26716
-rw-r--r-- 1 corey 5165 Mar 23 20:10 d271
-rw-r--r-- 1 corey 3952 Feb 10 20:09 d27323
EOF
-rw-r--r-- 1 corey 3802 Jan 27 20:09 d26716
-rw-r--r-- 1 corey 3952 Feb 9 20:09 d25181
-rw-r--r-- 1 corey 3952 Feb 10 20:09 d27323
-rw-r--r-- 1 corey 3986 Feb 22 20:09 d24533
-rw-r--r-- 1 corey 3986 Feb 23 20:09 d26135
-rw-r--r-- 1 corey 4146 Mar 8 20:09 d24629
-rw-r--r-- 1 corey 4146 Mar 9 20:09 d26348
-rw-r--r-- 1 corey 5165 Mar 23 20:10 d271
SEE ALSO
sed(1), sort(1)
AUTHOR
Corey Satten - corey @ cac.washington.edu
BUGS
Any line length limits in sed and sort apply here as well.
DATESORT(LOCAL)