aboutsummaryrefslogtreecommitdiff
path: root/files/.zsh/rc/S50_functions
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2016-07-21 19:27:37 +0500
committerAnton Bobov <abobov@gmail.com>2016-07-21 19:27:37 +0500
commit26c725916b18fc1baaae94bfd2e02e3076f53955 (patch)
treeb99dad56d08f87d89c343cdf40932a8602152076 /files/.zsh/rc/S50_functions
parent997ee7e2e6ad81f7a9455b581e71150173cec7d4 (diff)
[zsh] Update aliases and functions.
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"
}