Bash, tar, and broken pipe

Gary Weimer 253-7796 weimer at garden.ssd.kodak.com
Thu May 16 01:50:40 AEST 1991


In article <586 at kepler1.kepler.com>, jwu at kepler.com (Jasper Wu) writes:
|> 
|> 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.

In csh I use:

   uncompress -c foo.tar.Z | tar tvf -
              ^^

(I've never had a problem not using B for tar). I don't know if this
will fix your problem or not.

weimer at ssd.kodak.com ( Gary Weimer )



More information about the Comp.unix.shell mailing list