I have a shell script that pulls the number of online players, but I need a little help.
The script:
#!/usr/bin/bash
wget --output-document=- http://runescape.com/title.ws 2>/dev/null \
| grep PlayerCount \
| head -1l \
| sed 's/^[^>]*>//' \
| sed "s/currently.*$/$(date '+%r %b %d %Y')/"
It outputs the following:
<p class="top"><span>69,215</span> people 06:31:37 PM Nov 22 2011
What I would like it to say is this:
69,215 people 06:31:37 PM Nov 22 2011
Can any of you help me? 🙂
This is one of many different ways to do this. Used
cutandsed(cut -d">" -f 3,4 | sed 's/<\/span>//'):