3 ms·
Such a program in Python could be python3 -c 'import ipaddress, sys; print("\n".join(sorted(ipaddress.IPv6Address(x).exploded for x in sys.argv[1:])))' It t
by schoen 1y ago
Such a program in Python could be
python3 -c 'import ipaddress, sys; print("\n".join(sorted(ipaddress.IPv6Address(x).exploded for x in sys.argv[1:])))'
It takes the IP addresses to be sorted on the command line.
Or, re-abbreviating them by removing zeroes and attempting to use :: where possible:
python3 -c 'import ipaddress, sys; print("\n".join(str(ipaddress.IPv6Address(y)) for y in sorted(ipaddress.IPv6Address(x).exploded for x in sys.argv[1:])))'
Both of these versions will crash if given input that isn't syntactically valid as an IPv6 address.