fork download
  1. #!/bin/bash
  2.  
  3. IFS= readarray -d '' arr < <(awk -v RS= -v ORS='\0' '1')
  4.  
  5. echo "Output:"
  6.  
  7. for i in "${!arr[@]}"; do
  8. echo "[$i] =>"
  9. echo "${arr[i]}"
  10. done
  11.  
Success #stdin #stdout 0.01s 5260KB
stdin
Header 1
- Point 1
- Point 2

Header 2
- Point 1
- Point 2

Header 3
-Point 1
- Point 2
stdout
Output:
[0] =>
Header 1
- Point 1
- Point 2
[1] =>
Header 2
- Point 1
- Point 2
[2] =>
Header 3
-Point 1
- Point 2