Path: utzoo!attcan!telly!eci386!jmm From: jmm@eci386.uucp (John Macdonald) Newsgroups: comp.unix.xenix Subject: Re: Using tar with the 'r' option Keywords: tar append Message-ID: <1989Jun15.134720.15846@eci386.uucp> Date: 15 Jun 89 13:47:20 GMT References: <771@mccc.UUCP> <1188@sbee.sunysb.edu> Reply-To: jmm@eci386.UUCP (John Macdonald) Distribution: usa Organization: R. H. Lathwell Associates: Elegant Communications, Inc. Lines: 19 In article <771@mccc.UUCP>, pjh@mccc.UUCP (Pete Holsberg) writes: > Is there anyway to get tar to extract a file from an archive file and send it > to stdout (rather than to a file)? In article <1188@sbee.sunysb.edu> mhlevy@sbee.sunysb.edu (Mark Levy) writes: > >Try: > tar xvf - ( the '-' means stdout or stdin ) Sorry Mark, you misread the question - he wanted the extracted file to go to stdout, you are giving syntax for reading the archive from stdin. Pete, there is no way to do what you want with the tar's I'm familiar with. Nor is it possible using pax - the new PD Posix-compliant replacement for both tar and cpio - although, using its renaming capabilities, you can avoid overwriting a file of the same name or having the file be placed into some absolute pathname (so you could do it with a script that extracts the file into /tmp, copies it out to stdout, and deletes it, if that is acceptable).