Skip to content

Instantly share code, notes, and snippets.

@thomd
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save thomd/9092118 to your computer and use it in GitHub Desktop.
Save thomd/9092118 to your computer and use it in GitHub Desktop.
get currency from google via CLI
#!/bin/bash
currency() {
echo $(curl -s "http://www.google.com/finance/converter?a=1&from=$1&to=EUR" | sed '/currency_converter_result/!d;s/<[^>]*>//g' | cut -d " " -f 4)
}
gbp=$(currency "GBP")
echo $gbp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment