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


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



Relevant Pages

  • Re: Formatage date
    ... > How can I get the date format of the server with a vb script in an ASP ... > TIA ...
    (microsoft.public.inetserver.asp.general)
  • Install font
    ... anyway to script this process? ... TIA ... Peter ... Outgoing mail is certified Virus Free. ...
    (microsoft.public.word.printingfonts)
  • Re: Save-Restore state of services ?
    ... TIA ... I have a script that I wrote some time ago. ... considered dangerous (i.e. disabling lots of services) - so you'll be ... using at your own risk. ...
    (microsoft.public.scripting.vbscript)
  • Re: Hyperlinks in FMP6?
    ... this field, btw. TIA. ... Say your field name is <MyUrl> ... Make the field into a button, set it to perform script <Open URL> ...
    (comp.databases.filemaker)
  • [SLE] at now command
    ... How to issue a script now in Suse8.X? ... tia. ... parse error. ... Garbled time ...
    (SuSE)