Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Thanks. So, even RTFM is not enough ;-) I even looked into tar's code to see that there's a function that returns the next file name to be processed, which made me read the documentation again. -- So, stdout is directed to the gzip process via process substitution, and stderr is redirected to stdout which is processed by the next step in the pipe? Commented Mar 12, 2014 at 8:39
  • Yup. The > >() construct does not work in all shells, but it works in Bash. Commented Mar 12, 2014 at 9:17
  • I can confirm that tar reads the file list first, using the simple example I've added to my question. However, reading tar's source code again, it seems to me that it should read the list of files "on the fly" if not creating an incremental archive. Unfortunately, I have errors compiling tar from source... :-( Commented Mar 12, 2014 at 9:20
  • I haven't found a way to suppress the final line in the output of cpio, other than grep -v 'blocks$'. (head -n -1 uses a very large buffer...) Makes this solution a bit of a hack, but never mind ;-) Commented Mar 12, 2014 at 15:40
  • @krlmlr that is odd: My head -n -1 only uses 16MB when run on a few GB of data. You can always use perl: perl -ne 'print $last;$last=$_' Commented Mar 14, 2014 at 9:46