For example text below , in Linux, how to get the section below from the "will be installed" to the text before "Suggested packages".
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
python3-decorator python3-simplegeneric
Suggested packages:
ipython3-notebook ipython3-qtconsole python3-zmq
The following NEW packages will be installed:
ipython3 python3-decorator python3-simple-generic
0 upgraded, 3 newly installed, 0 to remove and 13 not upgraded.
And the output to get is simply " ipython3-notebook ipython3-qtconsole python3-zmq" , WITHOUT the beginning and ending pattern.
grep
regular expression syntax