Thoughts on Rails

Riding the Train of Thought

Check Western Grid data with a command…

leave a comment »

Note: not optimized, but it works.

#!/bin/bash curl -s | sed -n '/WR Grid Frequency/,/UI Rate/p' | sed -e 's#<[^>]*>##g' | sed 's/ / /g' | sed 's/UI Rate (Rs\/Unit)/ /g' | sed 's/ //g'

Output looks like this:
WRGridFrequency 50.07 LastUpdatedat: 31-Jul-201216:25:05

Yes, there are trailing new-lines that I am not sure how to get rid of easily, so letting them be. Suggestions welcome!

You can put this into TextExpander and have the output pasted into current window on-demand.


Written by hiway

July 31, 2012 at 4:28 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: