|
From: | Alexander Fieroch |
Subject: | bug#32751: split does not break on error from tar |
Date: | Tue, 18 Sep 2018 09:59:32 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
As far as I can tell, this is not a bug, but the way pipelines work, i.e. the result of a pipeline (here the combination of tar and split) is the result of the last command in the pipeline. If you want the combination to fail if tar fails, you can use e.g. set -o pipefail in bash or read PIPESTATUS. For other shells, see e.g. http://cfajohnson.com/shell/cus-faq-2.html#Q11 Rainer
Thanks Rainer, that is a very good hint and is working for me!But why is this not a bug? In what case is it useful to ignore a non-zero exit code in a pipeline?
Thanks! Best regards, Alexander
smime.p7s
Description: S/MIME Cryptographic Signature
[Prev in Thread] | Current Thread | [Next in Thread] |