tar frustration

Mark Wutka mark at iccdev.UUCP
Sat Aug 27 04:39:42 AEST 1988


In article <1249 at mcgill-vision.UUCP>, mouse at mcgill-vision.UUCP (der Mouse) writes:
> In article <2858 at ttrdc.UUCP>, levy at ttrdc.UUCP (Daniel R. Levy) writes:
> > All this points up a "feature" of tar which I find frustrating:
> > [...can't take random filenames except in argument list...].  "cpio"
> > circumvents this problem, since I can feed it a list of files, but
> > what if I don't WANT to use cpio?
> 
> You use a tar that can take filenames from stdin.  Mine can.  I think
> Gilmore's can.  (Mine also treats absolute pathnames on the tape
> specially, and has other frills.)

If you don't have a tar that will take files from stdin, you can try what
I have used here:

	tar <whatever> `cat listoffiles`

Hopefully this will work right on your shell. You can list the files
one per line if you like. I'm not sure if all the shells do this, but
the one I use - ksh - will concatenate the files into one long line
separated by spaces. Be careful, though, it may bomb if you give it
some enormous number of files. I haven't had a blow-up with several
hundred files, though.

If you want to make tar take from stdin, just try:

	tar <whatever> `cat`

This will works with other commands, of course. The only one that comes
to my mind right now is "ar". If you want to create a library and can't
really use wildcards you can do it this way.


-- 
...!gatech!ncrats!iccdev!mark

This is what happens when I roll my head on the keyboard:
kijmuhnyjuygikmluhygbtnjkm,l.jhnubgyvfnjmuki,lmnjhbgv



More information about the Comp.unix.wizards mailing list