fork download
  1. #!/bin/bash
  2. s='11bb1
  3. b222b
  4. b n b
  5. ww
  6. ee
  7. bb
  8. rrr
  9. fff
  10. 999
  11. 10
  12. 11 b nnnn bb
  13. www12'
  14. sed -ne '3,7{/b[^b]*b/p};11{/b[^b]*b/p}' <<< "$s"
  15. sed --version
Success #stdin #stdout 0.01s 5392KB
stdin
Standard input is empty
stdout
b  n    b
bb
11 b nnnn bb
sed (GNU sed) 4.7
Packaged by Debian
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://g...content-available-to-author-only...u.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
Paolo Bonzini, Jim Meyering, and Assaf Gordon.
GNU sed home page: <https://w...content-available-to-author-only...u.org/software/sed/>.
General help using GNU software: <https://w...content-available-to-author-only...u.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.