From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from netcomsv.netcom.com ([192.100.81.101]) by hawkwind.utcs.toronto.edu with SMTP id <2751>; Sun, 4 Oct 1992 01:55:22 -0400 Received: from netapp.UUCP by netcomsv.netcom.com with UUCP (4.1/SMI-4.1) id AA29125; Sat, 3 Oct 92 22:52:16 PDT Received: by netapp.netapp.com (4.1/SMI-4.1) id AA16988; Sat, 3 Oct 92 22:50:14 PDT Date: Sun, 4 Oct 1992 01:50:14 -0400 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9210040550.AA16988@netapp.netapp.com> To: boyd@prl.dec.com, john@civil.su.oz.au, rc@hawkwind.utcs.toronto.edu Subject: Re: compact - a history-file compaction command >Here's my version. I'm sorry I didn't send it out much earlier and save >everyone the effort of writing those foul script versions :). Please >comment. Ok, I will. I think writing a C program for this utility is wrong for the same reasons that people who aren't fluent with Unix approach such a problem by skipping to C first, rather than trying the tools cat -> tr -> sed -> awk ( or -> perl ) -> C in roughly that order. In this particular case, I would much rather implement this history compactor as tac | onlyfirst | tac since 1) a tac binary is useful in other circumstances, whereas by your admission a history compactor is pretty much that --- a history compactor. So why clutter up my bin directory with yet another binary? 2) it is not much slower than the C program you wrote. And in any case, I have a hard time believing that the performance of the solution is a big deal, esp. if you compact the file out of cron. And it is not so much faster that I would want to use your program, e.g., every time I logged in. 3) a shell solution is generally easier to develop & maintain, as discussed ad nauseam on the various comp.unix.* lists. My awk & rc scripts were written in a matter of minutes. With those three points aside, I'd like to thank you for the code. It's hard to argue with an existing implementation that you just need to compile up, providing you don't care about point #1. (However, I still think you wasted your time writing it.) Byron.