X-Git-Url: http://git.treefish.org/fex.git/blobdiff_plain/c65ee6f7429eff9a7f58aad7c0aec858ad473092..20160328:/bin/zz diff --git a/bin/zz b/bin/zz index 8195b87..0317412 100755 --- a/bin/zz +++ b/bin/zz @@ -2,7 +2,7 @@ # 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} @@ -30,26 +30,26 @@ Examples: (within tin:) |azz (within vi:) :w !zz (within vi:) :r !zz - + Limitation: zz does not work across different accounts or hosts! Use xx instead. EOD fi -if [ "$1" = + ]; then +if [ "$1" = + ]; then shift exec cat -- "$@" >>$ZZ fi if [ -t 0 ]; then - if [ -z "$1" ]; then + if [ -z "$1" ]; then exec cat -- $ZZ - elif [ "$1" = .. ]; 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