From: Michele OrrĂ¹ Date: Sat, 24 Jan 2015 17:19:06 +0000 (+0100) Subject: When piping notmuch search into xargs, use --no-run-if-empty. X-Git-Url: https://git.cworth.org/git?p=notmuch-wiki;a=commitdiff_plain;h=a9ad99631a50bde3181cf94327c52883cc7af138 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`. --- 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