title: Have sed search repeatedly from the beginning of the pattern space
body: <p>When you issue 's//g' commands in sed, the search is resumed, after every replacement, from right past the replaced patter. For example:</p>
  <pre><code>$ sed 's/foo/oog/g;'
  ffoo
  foog
  </code></pre>
  <p>while, if the command was applied again to the whole line, we would get <code>oogg</code> as the result (two replacements). Of course, one can just issue the same command twice, or three times - but what if I want it to run repeatedly until there are no matches? Can sed do this, or will I need to resort to awk?</p>