Ok, now I use the bash option
  set -o pipefail

and let split fail with the error code of tar.

** Changed in: coreutils (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/1792930

Title:
  split does not break on error when reading from standard input

Status in coreutils package in Ubuntu:
  Invalid

Bug description:
  Hi all,

  I found a bug in "split".
  I want to tar some files but some of them have wrong permissions. tar puts 
out an exit code 2 "Cannot open: Permission denied". That is good because in my 
script I can catch this error and react to this.

  $ tar -c -f /tmp/test.tar -C /media/testpath testfile ; echo $?
  tar: testfile: Cannot open: Permission denied
  tar: Exiting with failure status due to previous errors
  2

  Unfortunately my tar directory is too big to save it in one file on my
  filesystem that I have to split the archive. But doing this "split"
  does not get the error code 2 from standard input (tar) and does not
  break as it should:

  $ tar -c -f - -C /media/testpath testfile | split - ; echo $?
  tar: testfile: Cannot open: Permission denied
  tar: Exiting with failure status due to previous errors
  0

  In the end I got a tar file without files that have no permissions and
  my script does not break because of error code 0.

  
  ----
  Ubuntu 18.04.1
  tar 1.29b
  coreutils 8.28
  ----

  Best regards,
  Alexander

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1792930/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to