55

I am using the following sed command to replace some parameters in a config file:

sed -i 's/^option.*/option=value/g' /etc/fdm_monitor.conf

Now I have one problem. If the line does not exist, I want to add it to the bottom of the file.

I am calling this with a popen out of a C program. I tried using awk.

Nathan
  • 7,243
  • 6
  • 46
  • 67
Evilmachine
  • 601
  • 1
  • 6
  • 8

0 Answers0