I'm creating a script that connects to a server and dumps the output to a tempfile. I want to use sed in the script to grab specific information from the temp file. The output would always have the 80 char dashed line then the information I want followed by the Disconnected statement.
I've gotten a regex working if it was just a single line the trouble is how do I group the newlines as well?
Regex
-\{80\}[\r\n]*\(.*\)[\r\n]\{4\}Disconnected
File
...
--------------------------------------------------------------------------------
The information that I want to get can be a single line or multiple lines.
Another line to grab.
And this should be caught as well.
Disconnected ...
Desired output
The information that I want to get can be a single line or multiple lines.
Another line to grab.
And this should be caught as well.