/usr/bin/zz is in fex-utils 20160104-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #!/bin/sh
# to use zz with vim, write to your .vimrc:
#
# noremap <silent> zz> :w !zz<CR><CR>
# noremap <silent> zz< :r !zz<CR>
ZZ=${ZZ:-$HOME/.zz}
if [ "$*" = -h -o "$*" = --help ]; then
exec cat<<EOD
zz is the generic clip board program. See also the edit helper program ezz.
The clip board is \$ZZ (default: \$HOME/.zz). Options and modes are:
"zz" write \$ZZ to STDOUT
"zz file(s)" copy file(s) into \$ZZ
"zz -" write STDIN (keyboard, mouse buffer) to \$ZZ
"zz +" add STDIN (keyboard, mouse buffer) to \$ZZ
"... | zz" write STDIN from pipe to \$ZZ
"... | zz +" add STDIN from pipe to \$ZZ
"zz | ..." write \$ZZ to pipe
"zz .." write previous \$ZZ to STDOUT
Examples:
zz *.txt
ls -l | zz
zz | wc -l
(within mutt:) |zz
(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
shift
exec cat -- "$@" >>$ZZ
fi
if [ -t 0 ]; then
if [ -z "$1" ]; then
exec cat -- $ZZ
elif [ "$1" = .. ]; then
exec cat -- $ZZ~
else
test -f $ZZ && mv $ZZ $ZZ~
exec cat -- "$@" >$ZZ
fi
else
test -f $ZZ && mv $ZZ $ZZ~
exec cat >$ZZ
fi
|