aboutsummaryrefslogtreecommitdiff
path: root/files/.zsh/rc/S50_functions
diff options
context:
space:
mode:
Diffstat (limited to 'files/.zsh/rc/S50_functions')
-rw-r--r--files/.zsh/rc/S50_functions26
1 files changed, 26 insertions, 0 deletions
diff --git a/files/.zsh/rc/S50_functions b/files/.zsh/rc/S50_functions
index 7998441..b3b09ff 100644
--- a/files/.zsh/rc/S50_functions
+++ b/files/.zsh/rc/S50_functions
@@ -7,10 +7,36 @@ ppgrep() {
}
stocks() {
+ if [ -z "$1" ] ; then
+ cat <<EOM
+stocks NAME
+
+Get current stock value for NAME.
+
+Example:
+
+ $ stocks GOOG
+ $ stocks EURUSD=x
+EOM
+ return
+ fi
curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s='$1'&f=l1'
}
xe() {
+ if [ -z "$1" ] ; then
+ cat <<EOM
+xe NAME
+
+Get exchange rates.
+
+Example:
+
+ $ xe EURRUB
+ $ xe usdrub
+EOM
+ return
+ fi
stocks "$1=x"
}