diff options
author | Tom Willemsen | 2012-11-09 10:44:45 +0100 |
---|---|---|
committer | Tom Willemsen | 2012-11-09 10:44:45 +0100 |
commit | 41dca31756298ef9803172e6e982e554665258f9 (patch) | |
tree | 8e56f2395ccd9b48726df1b05099752f98ce109a /.config/zsh/functions/get_cnt | |
parent | 3104a8c298d964662bb09cc5e2a78d4bb1e104d0 (diff) | |
download | dotfiles-41dca31756298ef9803172e6e982e554665258f9.tar.gz dotfiles-41dca31756298ef9803172e6e982e554665258f9.zip |
Move ZSH configs
Diffstat (limited to '.config/zsh/functions/get_cnt')
-rw-r--r-- | .config/zsh/functions/get_cnt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.config/zsh/functions/get_cnt b/.config/zsh/functions/get_cnt new file mode 100644 index 0000000..5fc3d4f --- /dev/null +++ b/.config/zsh/functions/get_cnt @@ -0,0 +1,15 @@ +# -*- mode: shell-script -*- + +if [ -n "$1" ]; then + if [ -e "$HOME/.local/share/$1.cnt" ]; then + cnt=$(/bin/cat "$HOME/.local/share/$1.cnt") + fi + + if [ -z "$cnt" ]; then + cnt=0 + fi + + echo $cnt +else + echo "No count name specified" >&2 +fi |