GNU bug report logs - #32751
split does not break on error from tar

Previous Next

Package: coreutils;

Reported by: Alexander Fieroch <alexander.fieroch <at> mpi-dortmund.mpg.de>

Date: Mon, 17 Sep 2018 14:53:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #16 received at control <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Alexander Fieroch <alexander.fieroch <at> mpi-dortmund.mpg.de>,
 "Rainer M. Canavan" <coreutils <at> canavan.de>
Cc: 32751 <at> debbugs.gnu.org
Subject: Re: bug#32751: split does not break on error from tar
Date: Tue, 18 Sep 2018 01:06:24 -0700
tag 32751 notabug
close 32751
stop

On 18/09/18 00:59, Alexander Fieroch wrote:
>> 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?

Well that's been the shell behavior since the beginning,
and lot's of scripts depend on that,
and so it can't be changed.

As for split, it just sees the end of input
and exits without error.

thanks,
Pádraig





This bug report was last modified 6 years and 253 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.