fork(2) download
  1. #!/bin/bash
  2. s="Section1
  3. George, 1998-1995
  4. Peter, 1999-1990
  5. Simon, 1988-1960
  6. Section2
  7. Gery, 2019-2015
  8. John, 1984-1983
  9. Thomson, 1978-1965"
  10. sed --posix -n '/^Section1$/ , /^Section[0-9]*$/{:a;h;n;/^Section[0-9]*$/!ba;x;s/^[ \t]*//;p}' <<< "$s"
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
Simon, 1988-1960