rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: byron@netapp.com (Byron Rakitzis)
To: boyd@prl.dec.com, john@civil.su.oz.au, rc@hawkwind.utcs.toronto.edu
Subject: Re:  compact - a history-file compaction command
Date: Sun, 4 Oct 1992 01:50:14 -0400	[thread overview]
Message-ID: <9210040550.AA16988@netapp.netapp.com> (raw)

>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.


             reply	other threads:[~1992-10-04  5:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-04  5:50 Byron Rakitzis [this message]
1992-10-04  5:57 ` John Mackin
  -- strict thread matches above, loose matches on Subject: below --
1992-10-04  6:20 Byron Rakitzis
1992-10-03 23:17 John Mackin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9210040550.AA16988@netapp.netapp.com \
    --to=byron@netapp.com \
    --cc=boyd@prl.dec.com \
    --cc=john@civil.su.oz.au \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).