Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.unix.questions Subject: Re: tar frustration (was Re: relative pathname question!) Message-ID: <293@quintus.UUCP> Date: 14 Aug 88 21:05:02 GMT References: <1670003@hpcilzb.HP.COM< <5762@super.upenn.edu< <1414@valhalla.ee.rochester.edu< <2858@ttrdc.UUCP< <7056@conexch.UUCP> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 28 In article <7056@conexch.UUCP> root@conexch.UUCP (Larry Dighera) writes: >This is so simple that it makes me feel like I don't understand the problem. >If you want tar to take the names of the files it is to put into the archive >from a file which contains the names of the files, just do this: > > tar cvf /dev/whatever `cat file_of_names` > If I have understood correctly, the original problem is a very simple one: THERE IS A LIMIT ON THE SIZE OF THE COMMAND-LINE ARGUMENTS. A common figure for this limit is about ten thousand characters (look for NCARGS in). Now, suppose I want to put 200 files on a tape, each of which has a (relative) path name amouting to some 100 characters. OH DEAR. The problem never was TYPING the file names in the command, the problem was that if you have a lot of files to archive, the command line just gets too big to be accepted as a command. (I have run into this several times with `echo */*` and the like.) For many UNIX utilities, this is not a problem, because having many file names in one command is only a convenience anyway (e.g. *grep, awk, sed, sometimes wc, ...) and you can use xargs(1) to get the desired effect -- though that has some weird limits of its own -- but tar is different. With some drives you *can't* add to the end of a tape. As someone else pointed out, the answer is to use John Gilmore's PDtar, which amongst many other neat things has a '-T' option for reading names from a file.