Skip to content

Instantly share code, notes, and snippets.

@rahilwazir
Created October 28, 2016 09:43
Show Gist options
  • Save rahilwazir/895a94633ff1c43d65b6f51908c6ccac to your computer and use it in GitHub Desktop.
Save rahilwazir/895a94633ff1c43d65b6f51908c6ccac to your computer and use it in GitHub Desktop.
Bash Currency Converter

Code:

currency_convert() {
  curl -s "http://www.google.com/finance/converter?a=$1&from=$2&to=$3" | sed '/res/!d;s/<[^>]*>//g';
}

Usage:

$ currency_convert 1 usd eur
$ currency_convert 0.003 usd pkr

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment