Look at the output of this command in a Terminal window:
Another command to look at is 'cut'.
With a percentage number, the shell is capable of doing arithmetic and comparisons. Refer to the man page for your preferred shell.
Other languages would also work. Some of the Mac's builtin ones include awk, AppleScript (osascript cmd), perl, and Python. I'm sure I've omitted some.
Here's an article on using notifications from the command line:
I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write. Is there a built-in command or a third-party library I can use from either an
apple.stackexchange.com
Search terms: mac command line notification
MR's Programming forum is here:
programming for all Apple devices
forums.macrumors.com