Path: utzoo!utgpu!watserv1!watmath!uunet!samsung!brutus.cs.uiuc.edu!apple!portal!portal!cup.portal.com!thad From: thad@cup.portal.com (Thad P Floryan) Newsgroups: unix-pc.general Subject: Re: bsplit? Message-ID: <26489@cup.portal.com> Date: 1 Feb 90 11:49:52 GMT References: <12897@cbnewsc.ATT.COM> <26143@cup.portal.com> <1990Jan23.040408.27311@banzai.PCC.COM> <26391@cup.portal.com> <1990Jan30.051455.7500@cs.rochester.edu> Organization: The Portal System (TM) Lines: 34 ken@cs.rochester.edu (Ken Yap) in <1990Jan30.051455.7500@cs.rochester.edu> writes: Oh come on, what happened to reusing Unix tools? Here's a cheap bsplit, done in sh (hooray for redirection on builtins, fooey to csh on this point). for i in 1 2 3 4 5 do dd bs=10k count=1 of=part$i done < foo Edit as appropriate. Nothing's "wrong" with the above; thanks for the example and posting! But, per "Edit as appropriate", one has to know beforehand how many parts the original will be split into, and, here's the clinker to the above, your example does NOT perserve sequential order if there are more than 9 parts such that one could do (later, when repacking after a uucp) "zcat part* | .." because "part10" collates after "part1" but BEFORE "part2". In other words, an "ls part*" would sequence part1, part10, part2, part3, ... , part9 which is the incorrect order. The output of bsplit (and my xsplit) preserves collating sequence per partaa, partab, partac, ... partzz thus preserving the split-order. The benefit of "bsplit" is evident when uucp'ing the 40- or 60- or 90-part distributions from, say, osu-cis. Consider just the GNU gcc; it's a 20+ part archive on osu-cis, and the split-sequence is maintained (for zcat and UNIX' wildcarding) due to "aa", "ab", ..., "bh" suffixes on the filenames. Thad Floryan [ thad@cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]