Lets say I have an IP address of 123.456.789.01
I want to remove the last octet 123.456.789.01 but not the period.
So what I have left is 123.456.789.
Any help is appreciated. Thank you.
Linux Terminal
I tried isolating the final octet but that just gives me the last octet 01
not 123.456.789.
:
$ address=123.456.789.01
$ oct="${address##*.}"
$ echo "$oct"
01