extract_changes.awk 487 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/awk -f
  2. # Start echoing after the first list item
  3. /\* / {
  4. STARTED=1
  5. EMPTY_LINE=0
  6. }
  7. # Remember if we have seen an empty line
  8. /^[[:space:]]*$/ {
  9. EMPTY_LINE=1
  10. }
  11. # Exit when seeing a new version number
  12. /^v[[:digit:]]/ {
  13. if (STARTED) exit
  14. }
  15. # Print if the line is not empty
  16. # and restore the empty line we have skipped
  17. !/^[[:space:]]*$/ {
  18. if (STARTED) {
  19. if (EMPTY_LINE) {
  20. print ""
  21. EMPTY_LINE=0
  22. }
  23. print
  24. }
  25. }