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: 06/20/03
- Next message: sinapsi: "compare"
- Previous message: Richard L. Hamilton: "Re: What does :$(cal) do?"
- Next in thread: Ed Morton: "Re: Newbie Question: How to replace an entire line in a file when only part of it is known?"
- Reply: Ed Morton: "Re: Newbie Question: How to replace an entire line in a file when only part of it is known?"
- Reply: Damian Ibbotson: "Re: Newbie Question: How to replace an entire line in a file when only part of it is known?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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.
TIA
- Next message: sinapsi: "compare"
- Previous message: Richard L. Hamilton: "Re: What does :$(cal) do?"
- Next in thread: Ed Morton: "Re: Newbie Question: How to replace an entire line in a file when only part of it is known?"
- Reply: Ed Morton: "Re: Newbie Question: How to replace an entire line in a file when only part of it is known?"
- Reply: Damian Ibbotson: "Re: Newbie Question: How to replace an entire line in a file when only part of it is known?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|