How to using sed to change the last character from a match line ?
Exemple: /etc/network/interfaces
auto eth0
iface eth0 inet static
address 150.0.3.50
netmask 255.255.255.0
network 150.0.3.0
gateway 150.0.3.6
auto eth.....
How can I change only the host octet of the gateway ? I've a lot of machines to do that and each one is in a different network, but the gateway's octet is always the same.