Date: Sat, 3 Nov 2001 00:31:40 +0100 From: Cliff Sarginson <cliff@raggedclown.net> To: freebsd-questions@FreeBSD.ORG Subject: Re: Splitting a tar archive Message-ID: <20011103003140.A12569@raggedclown.net> In-Reply-To: <3.0.5.32.20011102163329.00faefc0@mail.sage-american.com>; from jacks@sage-american.com on Fri, Nov 02, 2001 at 04:33:29PM -0600 References: <3.0.5.32.20011102124221.00f94888@mail.sage-american.com> <3.0.5.32.20011102113219.00f94888@mail.sage-american.com> <20011101160655.O92340-100000@bsd.smnolde.com> <20011101222033.C53366-100000@jodie.ncptiddische.net> <3.0.5.32.20011102113219.00f94888@mail.sage-american.com> <3.0.5.32.20011102124221.00f94888@mail.sage-american.com> <a05100310b808b104839b@[206.128.102.10]> <3.0.5.32.20011102163329.00faefc0@mail.sage-american.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 02, 2001 at 04:33:29PM -0600, jacks@sage-american.com wrote: > This works impeccably: > Original file = hws-vol1.pdf > #split hws-vol1.pdf splittest -b 1m (gave the split files below) > > -rwxr--r-- 1 sageame sageame - 4638512 Aug 12 11:49 hws-vol1.pdf > -rw-r--r-- 1 sageame sageame - 4638512 Nov 2 16:15 split.pdf > -rw-r--r-- 1 sageame sageame - 1048576 Nov 2 14:12 splittestaa > -rw-r--r-- 1 sageame sageame - 1048576 Nov 2 14:12 splittestab > -rw-r--r-- 1 sageame sageame - 1048576 Nov 2 14:12 splittestac > -rw-r--r-- 1 sageame sageame - 1048576 Nov 2 14:12 splittestad > -rw-r--r-- 1 sageame sageame - 444208 Nov 2 14:12 splittestae > > Then: > cat splittestaa >> split.pdf > cat splittestab >> split.pdf > cat splittestac >> split.pdf > cat splittestad >> split.pdf > cat splittestae >> split.pdf > > ...gave the 100% correct file back as "split.pdf" > ...same size as original and it loads perfectly in the Acrobat Reader which > solves my problem with this one. > > I suspect there is a better way of "cating" the files than one-by-one...??? > Yes of course, as I said earlier they are lexically ordered, so a suitable shell expansion will do it.. try it with echo first. cat split* >split.pdf the expression for the expansion should be just enough to make the explansion only give you what you want, echo is your friend here. It is a very good habit to develop to check what a command might do if you execute it by first echo'ing it, paticularly to large directories where you are about to "rm" a lot of things :) The problem with split (and grep and sed and all the text tools) is that is just what they were designed for, the handling of lines of text, and they may well get confused with files that are not line oriented..viz. binaries. This is why, for example the program is "strings" is better for looking for strings of ascii in binary files than grep is ! It was made for the job. Hence the -b option in split, a fudge to overcome it's linedness. -- Regards Cliff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011103003140.A12569>