X-Git-Url: https://git.treefish.org/fex.git/blobdiff_plain/7fa382617fbaccc0ce522b2b3adbbee9db5ad227..20160328:/bin/zz?ds=sidebyside diff --git a/bin/zz b/bin/zz index 48a5a9f..0317412 100755 --- a/bin/zz +++ b/bin/zz @@ -2,12 +2,12 @@ # to use zz with vim, write to your .vimrc: # -# noremap zz> :w !zz +# noremap zz> :w !zz # noremap zz< :r !zz ZZ=${ZZ:-$HOME/.zz} -if [ "X$*" = X-h -o "X$*" = X--help ]; then +if [ "$*" = -h -o "$*" = --help ]; then exec cat<>$ZZ fi if [ -t 0 ]; then - if [ x"$1"x = xx ]; then + if [ -z "$1" ]; then exec cat -- $ZZ - elif [ x"$1"x = x..x ]; then + elif [ "$1" = .. ]; then exec cat -- $ZZ~ - else + else test -f $ZZ && mv $ZZ $ZZ~ exec cat -- "$@" >$ZZ fi else test -f $ZZ && mv $ZZ $ZZ~ exec cat >$ZZ -fi +fi