title: Bash replace string where specific condition is true
body: <p>I am trying to replace a string where a specific condition is true in the same line</p>
  
  <p>I have a file with some lines. I to replace a word (word1) with another (word2) in every line that starts with another word (word3)</p>
  
  <p>For example:</p>
  
  <pre><code>foo moo see
  kaa haa qee
  foo dee see
  uuu ooo rrr
  foo dee laa
  </code></pre>
  
  <p>I want to replace the word "see" with "raa" in every line which begins with "foo". So doing that will result in the lines being like:</p>
  
  <pre><code>foo moo raa
  kaa haa qee
  foo dee raa
  uuu ooo rrr
  foo dee laa
  </code></pre>
  
  <p>I was told that I can use sed to do that but I didn't figure out how to do that.</p>
  
  <p>Please help! (with sed only)</p>