I have a variable that contains an IP address.
ip=192.165.12.30
How can I replace the last octet with 0
so that it becomes as below?
ip=192.168.12.0
I have a variable that contains an IP address.
ip=192.165.12.30
How can I replace the last octet with 0
so that it becomes as below?
ip=192.168.12.0
Copyright © 2021 Jogjafile Inc.
You can use a parameter expansion: