You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
363 B
Plaintext

#!/bin/bash
set -eo pipefail
in_tmp() {
local tmp="$(mktemp)"
trap "rm $tmp" EXIT
cat > "$tmp"
(< "$tmp" xargs realpath -e | grep -v '^/tmp/') && exit 1
# All good
cat "$tmp"
rm "$tmp"
trap - EXIT
}
najdi_duplikaty() {
fdupes . ~/SZDC/Mapy/ -1 | cut -f2 -d' ' | in_tmp
}
# Tohle neni bezpecne spoustet bez rozmyslu!!
najdi_duplikaty # | xargs rm -v