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
  • 8,093
  • 8
  • 50
  • 76
Evilmachine
  • 601
  • 2
  • 6
  • 8

0 Answers0