title: sed replace a word at a line which begins with a specific pattern using
body: <p>How can I replace a word at a line which begins with a specific pattern on FreeBSD?
  Consider the following file contents:</p>
  <pre><code>this is to test 
  that was for test
  </code></pre>
  <p>I want to replace &quot;test&quot; at the line which begins with &quot;this&quot;.</p>