]> Sergey Matveev's repositories - nnn.git/commitdiff
Skip rm invocation when no files to delete
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 9 Nov 2020 19:06:16 +0000 (00:36 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 9 Nov 2020 19:06:16 +0000 (00:36 +0530)
plugins/dups

index 02954e8372a35b77fb0558255fdc9dea716ead6d..98e8f72751e0213f3d98a77d6f77619d6ac910b9 100755 (executable)
@@ -58,10 +58,10 @@ read -r force
 
 if [ "$force" = "f" ]; then
        #shellcheck disable=SC2016
-       sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 sh -c 'rm -f "$0" "$@" </dev/tty'
+       sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -f "$0" "$@" </dev/tty'
 else
        #shellcheck disable=SC2016
-       sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 sh -c 'rm -i "$0" "$@" </dev/tty'
+       sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -i "$0" "$@" </dev/tty'
 fi
 
 rm "$tmpfile"