remove links with normal rm

This commit is contained in:
q
2017-05-31 20:58:45 +03:00
parent 12b596ec3e
commit 2649769d05

View File

@@ -6,7 +6,7 @@ function helpexit() {
echo This command is always recursive to folders!
echo '-f Do not ask questions'
echo '--nc Do not count files first'
echo '--shred Use "shred -u" instead of rm'
echo '--shred Use "shred -u" instead of rm. WARNING: modifies hardlinked files!'
exit
}
@@ -38,7 +38,11 @@ function deletefiles() {
[[ $files -ne 0 ]] && percent=$((200*$i/$files % 2 + 100*$i/$files))
printf "\r%02d:%02d:%02d %6d/%d %3d%% %s\033[0K" \
$(($SECONDS/3600)) $(($SECONDS%3600/60)) $(($SECONDS%60)) $i $files "$percent" "$line"
if [ -L "$line" ]; then
rm $RMFORCE "$line"
else
$RMCOMMAND $RMFORCE "$line"
fi
done < <(find "$@" \( -type f -or -type l \) -print0)
printf "\n"
}