]> git.cworth.org Git - notmuch-wiki/commitdiff
When piping notmuch search into xargs, use --no-run-if-empty.
authorMichele Orrù <maker@tumbolandia.net>
Sat, 24 Jan 2015 17:19:06 +0000 (18:19 +0100)
committerMichele Orrù <maker@tumbolandia.net>
Sat, 24 Jan 2015 17:19:06 +0000 (18:19 +0100)
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

index ef9b1a74ddfaa100e043386049edcea8c5b4a872..4e54a85465fc3fa3ef80c73ef6c204ea4e076734 100644 (file)
@@ -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