fork(2) download
  1. #!/bin/bash
  2. # http://s...content-available-to-author-only...r.com/questions/892924/append-text-to-lines-between-two-patterns-every-time-they-appear-in-a-file
  3.  
  4. sed '/<code>/,\%</code>%s:$:<br/>:' <<':'
  5. some text
  6. some more text
  7. <code>
  8. some code
  9. some more code
  10. </code>
  11.  
  12. we are done
  13. heros of the night
  14. <code>
  15. code code code
  16. ka-ching
  17. </code>
  18.  
  19. now finally really
  20. done.
  21. :
  22.  
Success #stdin #stdout 0s 5076KB
stdin
Standard input is empty
stdout
some text
some more text
<code><br/>
some code<br/>
some more code<br/>
</code><br/>

we are done
heros of the night
<code><br/>
code code code<br/>
ka-ching<br/>
</code><br/>

now finally really
done.