1 2 3 4 5 6 7 8 9
#!/bin/sh if [ x"$1" = x ]; then echo "Usage: $0 <cidr>" >&2; exit 255 fi dn=$(dirname "$0") ip=$("$dn"/cidr2ip "$1") || exit 1 "$dn"/ip2hex "$ip"