Newbie Question: How to replace an entire line in a file when only part of it is known?
From: Shmulik (shmulik28_at_yahoo.com)
Date: 19 Jun 2003 16:53:10 -0700
I have a file that has several lines. I need to create a script that
will search for a specific parameter line and replace it entirely with
a new one, something like this:
master set VAR my_var_one ##SomeValue##
What I'd like to do is something like this:
sed s/"master set VAR my_var_one"/"master set VAR my_var_one ##NEW
VALUE##/ curFile > newFile
What I want to know is how to I eliminate/replace the entire line - if
I run the above script, I would still have the "##SomeValue##" - but
this value changes all the time, so I can't rely on knowing what it is
at any time, so I just want to overwrite the entire line - the only
constant is the first part of the sentence.