Skip to content

Instantly share code, notes, and snippets.

@Kein1945
Last active May 17, 2020 13:29
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 Kein1945/669b0aa0ffddef7329b4116bfd39958f to your computer and use it in GitHub Desktop.
Save Kein1945/669b0aa0ffddef7329b4116bfd39958f to your computer and use it in GitHub Desktop.
[DEPRECATED] Bash currency converter, uses google conveter. Google closed that feature
money() {
to=${3:-rub}
from=${2:-usd}
count=${1:-1}
wget -qO- "http://www.google.com/finance/converter?a=$count&from=$from&to=$to" | sed '/res/!d;s/<[^>]*>//g';
}
alias m='money'
@Kein1945
Copy link
Author

to - your default currency (in example Ruble)
from - default currency of value
count - default value to convert

$ m 10 USD EUR
10 USD = 9.3970 EUR
$ m 10 THB
10 THB = 16.6050 RUB
$ m 5
5 USD = 291.1655 RUB
$ m
1 USD = 58.2331 RUB

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