Walt Mankowski on Mon, 4 Nov 2002 18:40:55 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] split & cat


On Mon, Nov 04, 2002 at 05:45:00PM -0500, gabriel rosenkoetter wrote:
> On Mon, Nov 04, 2002 at 03:53:00PM -0500, Walt Mankowski wrote:
> > split(1) (at least GNU's version) works just fine with binary files.
> 
> But (and I think we've had this generic argument before),
> Sun's/SGI's/whatever's may not. So it's a bad idea to get in the
> habit. And dd(1) is more versatile anyway.

By that same argument you'd never use any of the nonstandard features
in the GNU utilities.

> What's more, split(1), by default, divides a file into files of "1000
> lines", and doesn't have a good way to specify a byte boundary,
> which is what you really want to specify. (A binary file may simply
> not contain a ^J or a ^M anywhere.) GNU's -b flag sort of lets you
> do this, but it may make reconsruction later complicated. (Was there
> a CR? Was there an LF? Were there both? Neither? Did split(1)
> swallow them?)

That might be an issue in general, but it this case it will work just
fine.  copy /b foo+bar baz will reconstruct the file without changing
anything in foo or bar.

> dd(1) is the Right tool for breaking up files along byte (or disk
> block, or whatever arbitrary size larger than a byte you like)
> boundaries.

I disagree.  The Right Tool is whatever lets you get your job done
most easily, not whatever works generically on the most different
platforms.  If you have GNU's split, it's a lot easier to use than dd.
Why not use better tools if you have them available?

Attachment: pgpmrgEZPcfay.pgp
Description: PGP signature