From a9ad99631a50bde3181cf94327c52883cc7af138 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michele=20Orr=C3=B9?= Date: Sat, 24 Jan 2015 18:19:06 +0100 Subject: [PATCH] When piping notmuch search into xargs, use --no-run-if-empty. This might be useful to avoid non-zero returncodes when there are no search results and xargs' command expect one or more arguments, like in `rm`. --- excluding.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/excluding.mdwn b/excluding.mdwn index ef9b1a7..4e54a85 100644 --- a/excluding.mdwn +++ b/excluding.mdwn @@ -48,7 +48,7 @@ be used to train a spam filter: It can also be used to purge mail files from disk: - $ notmuch search --format=text0 --output=files tag:deleted | xargs -0 rm + $ notmuch search --format=text0 --output=files tag:deleted | xargs -0 --no-run-if-empty rm Make sure you run "notmuch new" after the last command so the database becomes aware that the files have been removed and can remove the -- 2.43.0