I'm working on an automation script and I need to change the value in a config file. The config file that I'm trying to edit has multiple lines one of which is this (including the spaces before):
"peer-port": 23456,
The script that I'm writing will pass a new port that is stored in a variable called $newport. How can use a sed (or awk) command to replace "23456" with the new port value contained in the variable $newport?
Thanks!!