$ IP="1234.2345.3456.4578"
$ echo $IP | cut -d. -f3
3456
by the way, i don't think it solves any of your exact problems, but
$ man ipcalc
thanks all - i have 'solved' this in my case (no pun intended) with the
following
ADDR=`ifconfig | grep inet | head -1 | awk {'print$2'} | cut -d. -f3`
case "$ADDR" in
66)
wget
http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.66;
;;
76)
wget
http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.76';
;;
77)
wget
http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.77';
;;
78)
wget
http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.78';
;;
86)
wget
http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.86';
;;
*)
wget
http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.default;
;;
esac