Merge pull request #1300 from N-R-K/rsynccp_fix

[rsynccp & fzcd]: avoid using non-portable xargs flag
This commit is contained in:
Arun 2022-02-01 18:28:41 +05:30 committed by GitHub
commit fbb2172627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -55,15 +55,15 @@ if [ -n "$LIST" ]; then
fi
done < "$LIST"
sel=$(xargs -d '\n' -a "$tmpfile" -I{} find {} -type f -printf "%H//%P\n" | sed '/.*\/\/\(\..*\|.*\/\..*\)/d; s:/\+:/:g' | fzf --delimiter / --tiebreak=begin --info=hidden)
sel=$(xargs -d '\n' < "$tmpfile" -I{} find {} -type f -printf "%H//%P\n" | sed '/.*\/\/\(\..*\|.*\/\..*\)/d; s:/\+:/:g' | fzf --delimiter / --tiebreak=begin --info=hidden)
# Alternative for 'fd'
# sel=$(xargs -d '\n' -a "$tmpfile" fd . | fzf --delimiter / --tiebreak=begin --info=hidden)
# sel=$(xargs -d '\n' < "$tmpfile" fd . | fzf --delimiter / --tiebreak=begin --info=hidden)
rm "$tmpfile"
else
printf "find missing"
read -r _
exit 1
exit 1
fi
fi

View File

@ -15,10 +15,10 @@ sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
# Choose one of these two schemes by commenting
# more verbose
xargs -0 -a "$sel" -I % rsync -ah --progress % "$PWD"
xargs -0 -I % rsync -ah --progress % "$PWD" < "$sel"
# less verbose
# xargs -0 -a "$sel" -I % rsync -ah --info=progress2 % "$PWD"
# xargs -0 -I % rsync -ah --info=progress2 % "$PWD" < "$sel"
# Clear selection
if [ -p "$NNN_PIPE" ]; then