Thanks.. I copy /pasted this in to script on its own and ran and it works fine - but it doesnt seem to complete... it doesnt return to command line unless I CTRL-C
Do you know why this is? is there something missing to end the for loop?
-----Post Update-----
Actually - this doesnt appear to work as I had hoped.
ie. If my start ip was 192.168.1.1 and end was 192.168.2.4 then in the script above i <=1 and j<=4 so I only get the following listed
## A1 list
a1ipaddnumb=$a1ipadd
while [ $a1ipaddnumb -le 254 ]
do
echo "194.20.$a1subnet.$a1ipaddnumb"
a1ipaddnumb=$(($a1ipaddnumb+1))
done
## Any list between A1 and B1
xsubnet=$(($a1subnet+1))
if [ $xsubnet -lt $b1subnet ]
then
while [ $xsubnet -lt $b1subnet ]
do
xipaddnumb=1
while [ $xipaddnumb -le 254 ]
do
echo "194.20.$xsubnet.$xipaddnumb"
xipaddnumb=$(($xipaddnumb+1))
done
xsubnet=$(($xsubnet+1))
done
fi
## B1 list
b1ipaddnumb=1
while [ $b1ipaddnumb -le $b1ipadd ]
do
echo "194.20.$b1subnet.$b1ipaddnumb"
b1ipaddnumb=$(($b1ipaddnumb+1))
done