fork download
  1. /^bad$/{
  2. bad_found=1
  3. }
  4. /^verybad$/{
  5. bad_found=""
  6. }
  7. /endline1/{
  8. found=""
  9. }
  10. /startline1/{
  11. found=1
  12. }
  13. found && !bad_found{
  14. sub(/nice/,"decent")
  15. }
  16. 1
Success #stdin #stdout 0s 4224KB
stdin
startline1
top
nice
good
bad
nice
nice
verybad
Extremely bad
bad
nice
endline1
nice
stdout
startline1
top
decent
good
bad
nice
nice
verybad
Extremely bad
bad
nice
endline1
nice