Hello,
I have tried and tried messing around with
I am in need of searching for and replacing, name/value pairs in a configuration file. An example would look something like this...
Nothing too complex... However, the issue is that the file can be hand edited, so spacing at the beginning and in between each piece can be variable...
Any idea on the
Many thanks,
I have tried and tried messing around with
sed
and regular-expressions but I just cannot find a solution. So I thought I would post this to the forum for some help...I am in need of searching for and replacing, name/value pairs in a configuration file. An example would look something like this...
Apache config:
variable = value # Comment.
Nothing too complex... However, the issue is that the file can be hand edited, so spacing at the beginning and in between each piece can be variable...
Any idea on the
sed
syntax needed to search for a variable and replace its value?Many thanks,