sed with escapes AND spaces?

It's been covered in lots of places, and I have banged on it for about an hour and I am not making any headway on this particular string.

A weather-related web page I want to monitor has text on the screen, but it changes. Right now, the page has "None issued by this office recently." but in 2 hours it could say "Noah, Build me an ark". So to get around the "None issued by this office recently." blurb, I though I'd use "sed /from/,/to/..." but I am stuck on all the escapes and :[blank]s.

These are the elements that I "think" will do what I need for the "sed /from/,/to/"

<!-- // CONTENT STARTS HERE -->
<!-- // CONTENT ENDS HERE -->

I used

sed -n '/LSRMKX/,/RKAPELA/p'
sed -n '/HWOMKX/,/\$\$/p'

on 2 web pages that have weather data/content and that works wonderfully.

I need some sed.fu to sed between these 2 elements/strings
starting at

<!-- // CONTENT STARTS HERE -->

and ending at

<!-- // CONTENT ENDS HERE -->

I believe that would be a more comprehensive solution to my task.

What I have tried in shown here.
SUSE Paste

GNU sed version 4.2.1
GNU bash, version 4.1.10

Thank you for your time.

If I understand right you need just to change your delimeters:

sed -n '\|START|,\|END|p' INPUTFILE

Or if you want to get only lines between START and END then

sed -n '\|START|,\|END| { \|START|d; \|END|d; p }' INPUTFILE

Thansk yazu:

Here's the page:
National Weather Service Text Product Display

I need any/all text in the source after

<hr noshade="noshade" align="left" size="1" width="520"></div>

here's another url I did manage to clean up for this task:
http://forecast.weather.gov/product.php?site=MKX&issuedby=MKX&product=LSR&format=txt&version=1&glossary=0
and what I used to clean it is:

sed -n '/LSRMKX/,/RKAPELA/p' 

Thank you for your time.

To get the last <div>...</div> between $start and $end:

$ start='<!-- // CONTENT STARTS HERE -->'
$ end='<!-- // CONTENT ENDS HERE -->'
$ curl -s 'http://www.crh.noaa.gov/product.php?site=MKX&product=SVR&issuedby=MKX' \
  | sed -n '\#'"$start"'#, \#'"$end"'# p'  | tr '\n' ' ' | sed 's#^.*\(<div>.*</div>\).*$#\1#'
<div><span style="color:Red;">None issued by this office recently.</span></div>
1 Like

Thanks yazu,

I took another approach and wrote a shutdown script for "Severe Thunderstorms" using conkyForest, a shell script and a cron for the "user"

Linux Mint Forums � View topic - Automate shutdown during thunderstorm warning script is the script/instructions.

I didn't mean to waste your time.

Thank you very much.