X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=nnn%2Fbin%2F_nnn-cp;fp=nnn%2Fbin%2F_nnn-cp;h=8a8a395cd33a21d402b3ad835a7d1e08c641a788;hp=ca733b4c0c2a3e13ff2366ed360b445f99730fce;hb=4628a7799d0108c76fe4d7342a56935a70b1ee5b;hpb=6ce9ebbc272339864f2a042b1c293e3419a454e3 diff --git a/nnn/bin/_nnn-cp b/nnn/bin/_nnn-cp index ca733b4..8a8a395 100755 --- a/nnn/bin/_nnn-cp +++ b/nnn/bin/_nnn-cp @@ -3,10 +3,11 @@ set -e sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} [[ -s $sel ]] -read -d $"\x00" -A tgts < $sel || : +tgts=$(xargs -0 -L1 < $sel) +tgts=(${(f)tgts}) size=$(du -A -c $tgts) size=(${=size}) size=${size[$#size - 1]} -for tgt ($tgts) ( cd $tgt:h ; tar cf - $tgt:t ) | +for tgt ($tgts) { pushd $tgt:h ; tar cf - $tgt:t ; popd } | pv --wait --interval 0.5 --size ${size}k | tar xf - --options read_concatenated_archives