Plan 9 from Bell Labs’s /usr/web/sources/contrib/boyd/sys/src/cmd/ipsort.html

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


<html>
<body>
<pre>
<tt>
#!/bin/sh

#
# ipsort
#
# A filter to sort a file like /etc/hosts by IP address.
#

ip='[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'

sed "s/^\($ip\)/\1./" | sort -n -t. +0 -1 +1 -2 +2 -3 +3 -4 | sed "s/^\($ip\)./\1/"
</tt>
</pre>
<HR>
&copy 1998,
Boyd Roberts:
<A HREF="mailto:boyd@fr.inter.net">boyd@fr.inter.net</A>
</body>
</html>

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.