Using tar with the 'r' option

John Macdonald jmm at eci386.uucp
Thu Jun 15 23:47:20 AEST 1989


In article <771 at mccc.UUCP>, pjh at 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 at sbee.sunysb.edu> mhlevy at 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).



More information about the Comp.unix.xenix mailing list