Can anyone guide me on how to modify the first two octets in the IP address using shell script?
I tried to modify this code but it didn't work. Any guidance or help will be appreciated.
This example will replace the last octet:
cat test.sh
ip=$1
baseip=`echo $ip | cut -d"." -f1-3`
echo $baseip".0"
./test.sh 192.168.133.14
192.168.133.0