I am trying to use bash to parse and HTML file using grep.
The HTML won't change so I should be able to find the text easy enough.
The HTML will be like this, and I just want the number which will change each time the file changes:
<div class="total">
900 files inspected,
28301 offenses detected:
</div>
grep -E '^<div class="total">.</div>' my_file.html
Ideally I just want to pull the number of offenses so in the example above it would be 28301. I would like to assign it to a variable also.
Am I close?