X-Git-Url: http://git.treefish.org/fex.git/blobdiff_plain/e60096926213ce02293a261254ff065cae44c1c8..cdeb354c4dbb11b683f9f8c5db2861f3dc572c61:/bin/zz?ds=inline 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