I have the following in my config.txt file.
some text
firmware_version 12.3
some more text ...
The sed -i 's/^firmware_version .*/firmware_version 12.4/' /config.txt command replaces the firmware version but
what I'd like to be able to do is that even if sed doesn't find a line occurrence of "firmware_version .*" it still adds the new replacement.
In other words if my config.txt file includes the following:
some text
some more text ...
I'd still like the end result to be
some text
firmware_version 12.4
some more text ...
I just want to come up with a universal one line command for this.
Thanks!