From bcadf4772ce3548c651e376a9e39130464447072 Mon Sep 17 00:00:00 2001 From: Mitch Tishmack Date: Sun, 11 Jan 2015 23:32:38 -0600 Subject: [PATCH] Add cconv aka currency convert so I don't need to waste time opening a web browser for currency conversion. Yeah, I'm that weird. --- common/.profile.d/20-functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/.profile.d/20-functions.sh b/common/.profile.d/20-functions.sh index 5c81c2e..88d9ef7 100644 --- a/common/.profile.d/20-functions.sh +++ b/common/.profile.d/20-functions.sh @@ -80,3 +80,10 @@ login_shell() { [ "$-" = "*i*" ] } + +# Yeah, sick of using the web browser for this crap +# Use is NUM FROM TO and boom get the currency converted from goggle. +cconv() +{ + curl -L --silent "https://www.google.com/finance/converter?a=$1&from=$2&to=$3" | grep converter_result | perl -pe 's|[<]\w+ \w+[=]\w+[>]||g;' -pe 's|[<][/]span[>]||' +}