Bash, tar, and broken pipe

Jasper Wu jwu at kepler.com
Wed May 15 06:39:41 AEST 1991


I have some problem when using pipelined tar in bash and hope someone
can help me find out why.

When I do    
           zcat foo.tar.Z | tar tvfB -
    or     uncompress < foo.tar.Z | tar tvfB -

it gives me the table of contents correctly but reports an error
message "Broken pipe" to stderr when it finishes.   However, if i add 
a "cat" to the pipeline as
           cat foo.tar.Z | uncompress | tar tvfB -

then it works fine (i.e., no error message).  All commands above work fine
in csh or sh.

The machine is Sparcstation running SunOs 4.1.1; the compiler used to compile
bash is Sun's cc.  The particular file in my case is bison-1.14.tar.Z (245kb)
if that matters.

Any ideas?  Has any one experienced the same problem?  Did i miss something
obvious (i'm new to bash) ?  Any comments will be greatly appreciated.

--jasper




More information about the Comp.unix.shell mailing list