Skip to content

Instantly share code, notes, and snippets.

@TomK32
Forked from hasantayyar/currency_convert.sh
Last active October 13, 2017 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomK32/3afbb1208ced01d761785e24e413c130 to your computer and use it in GitHub Desktop.
Save TomK32/3afbb1208ced01d761785e24e413c130 to your computer and use it in GitHub Desktop.
cli currency_convert
# seen on https://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know/answer/Jostein-Austvik-Jacobsen?__snids__=1567875257&__nsrc__=4
# usage currency_convert 14.99 eur usd
# output 14.9900 EUR = 16.7019 USD
currency_convert() {
wget -qO- "http://finance.google.com/finance/converter?a=$1&from=$2&to=$3" | sed '/res/!d;s/<[^>]*>//g';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment