4.0.41.198.in-addr.arpa. 897 IN PTR a.root-servers.net.
6.0.41.198.in-addr.arpa. 900 IN PTR rs.internic.net.
.fi
-.P
-Sort the \(dqreduced\(dq output:
-
-.nf
-.I $ echo \(dq192.168.0.100/24 192.167.1.200/24\(dq | hath reduced | sort
-192.167.1.200/24
-192.168.0.100/24
-.fi
-
-Sorting the output only makes sense for the \(dqreduced\(dq mode. In
-that mode, two output CIDRs cannot have same the numeric address and a
-different mask: one of them would contain the other, and the redundant
-one would be eliminated. As a result, there is no need for a special
-CIDR sort; the lexical or numerical sort provided by the \(dqsort\(dq
-utility will produce the same results as a more intelligent sort.
.SH OPTIONS
.IP \fB\-\-barriers\fR,\ \fB\-b\fR
.I $ echo x127.0.0.1x | grep -Po $(echo 127.0.0.1/32 | hath -b)
x127.0.0.1x
.fi
-
.IP \fB\-\-normalize\fR,\ \fB\-n\fR
(reduced mode only)
.I $ echo 127.0.0.1/8 | hath reduced --normalize
127.0.0.0/8
.fi
+.IP \fB\-\-sort\fR,\ \fB\-s\fR
+(reduced mode only)
+
+Sort the output CIDRs numerically by octet. The \(dqsort\(dq utility
+doesn't understand IP addresses, so the default pipe-to-sort approach
+fails in some cases:
+
+.nf
+.I $ echo \(dq10.0.121.32/28 10.0.93.248/29\(dq | hath reduced | sort
+10.0.121.32/28
+10.0.93.248/29
+.I $ echo \(dq10.0.121.32/28 10.0.93.248/29\(dq | hath reduced | sort -n
+10.0.121.32/28
+10.0.93.248/29
+.fi
+
+That failure justifies adding the additional option to hath:
+
+.nf
+.I $ echo \(dq10.0.121.32/28 10.0.93.248/29\(dq | hath reduced --sort
+10.0.93.248/29
+10.0.121.32/28
.SH BUGS
Send bugs to michael@orlitzky.com.