UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 19.7 Extracting Files from a Compressed Archive Chapter 19
Creating and Reading Archives
Next: 19.9 A System V Tape Archiver: cpio
 

19.8 Problems with Verbose tar

I've heard of one tar version with a v (verbose) option that writes the verbose information to its standard output, rather than standard error. If your tar does that, be sure not to use v when you're using tar to write to a pipeline. For example, the command that follows would be a disaster if your version of tar has this bug:

% tar cvf - *.txt | gzip > archive.tar.gz

The filenames would appear in standard output, along with the tar archive itself. The result would be a gzipped archive that couldn't be extracted. (You'd probably get a "checksum error" from tar, or something similar, if you tried.)

You can test for this problem by typing:

% tar cvf - somefile > /dev/null   tar without v bug
a somefile 23 blocks, 44567 characters

That redirects standard output to /dev/null (13.14). If you don't see any verbose output, your tar has the bug.

- JP


Previous: 19.7 Extracting Files from a Compressed Archive UNIX Power ToolsNext: 19.9 A System V Tape Archiver: cpio
19.7 Extracting Files from a Compressed Archive Book Index19.9 A System V Tape Archiver: cpio

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System