mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Fix filenames with spaces not working
This commit is contained in:
parent
782df96080
commit
afdba193e4
|
@ -21,7 +21,9 @@ size_digits=12
|
||||||
tmpfile=$(mktemp "$TMPDIR/.nnnXXXXXX")
|
tmpfile=$(mktemp "$TMPDIR/.nnnXXXXXX")
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
find . -size +0 -type f -printf "%${size_digits}s %p\n" | sort -rn | uniq -w"${size_digits}" -D | tr '\n' '\0' | xargs -0 -n1 sh -c 'printf "%s %s\n" "$(md5sum $@)" "d$0"' | sort | { uniq -w32 --all-repeated=separate; echo; } | sed -nE '
|
find . -size +0 -type f -printf "%${size_digits}s %p\n" | sort -rn | uniq -w"${size_digits}" -D | sed -E '
|
||||||
|
s/^ {,12}([0-9]{,12}) (.*)$/printf "%s %s\\n" "$(md5sum "\2")" "d\1"/
|
||||||
|
' | tr '\n' '\0' | xargs -0 -n1 sh -c | sort | { uniq -w32 --all-repeated=separate; echo; } | sed -nE '
|
||||||
h
|
h
|
||||||
s/^(.{32}).* d([0-9]*)$/md5sum: \1 size: \2 bytes/p
|
s/^(.{32}).* d([0-9]*)$/md5sum: \1 size: \2 bytes/p
|
||||||
g
|
g
|
||||||
|
@ -36,7 +38,7 @@ p' | sed -E 's/^.{32} (.*) d[0-9]*$/\1/' > "$tmpfile"
|
||||||
cat "$tmpfile"
|
cat "$tmpfile"
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
sed -e 's/md5sum.*//' "$tmpfile" | tr '\n' '\0' | xargs -0 sh -c 'rm -i $0 $@ < /dev/tty'
|
sed -e 's/md5sum.*//' "$tmpfile" | tr '\n' '\0' | xargs -0 sh -c 'rm -i "$0" "$@" < /dev/tty'
|
||||||
|
|
||||||
rm "$tmpfile"
|
rm "$tmpfile"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue