I don’t know how to trim text honestly.
What I have so far:
wget --output-document=- http://www.geupdate.com 2>/dev/null \
| grep last \
Outputs:
<li><b><img src='http://www.geupdate.com/img/arrow-tail.png' align='left'>Time since last update</b>: <br />0 day, 19 hours, 23 min, 36 sec</li><li><b><img src='http://www.geupdate.com/img/ledlightblue.png' align='left'>An Update to occur within:</b> (<a href='http://www.geupdate.com/update-prediction/'><font size='-2'>?</font></a>) <br />0 day, 21 hours, 56 min, 30 sec</li> </ul>
What I actually want to trim out of this is:
0 day, 19 hours, 23 min, 36 sec
If anyone can tell me how write something or write it if it’s that simple, that would be nice!
When I run this:
wget --output-document=- http://www.geupdate.com 2>/dev/null \
| grep last \
| grep -o '[[:digit:]]* day.* sec'
I get this:
0 day, 19 hours, 43 min, 16 sec</li><li><b><img src='http://www.geupdate.com/img/ledlightblue.png' align='left'>An Update to occur within:</b> (<a href='http://www.geupdate.com/update-prediction/'><font size='-2'>?</font></a>) <br />0 day, 21 hours, 36 min, 50 sec
1 Answer