README for (working title) CLIPCODE
===================================

This is a simple command for getting details from configuration files,
for use with shell scripts. It can also manipulate these configuration
files in various ways. It has no friendly user-interface, other
than a set of CLI options.

To build it, you need the development files for libpcre (version 3?),
and you just type "make" in this directory. The program "clipcode"
should then be copied to somewhere in your path.

NB- The job of parsing the configuration files that CLIPCODE does is
a relatively simple one, and could probably be done quite easily
with things like SED and GREP and PERL. But I felt it was important
to have a command whose usage and purpose was quite clear.

It also occurred to me since starting work on it, that various shell
scripts might solve the configuration problem by means of environment
variables, which would be easily accessible.  Of course, these aren't
persistent between logins (unless you put them in your profile or
wherever). There's also the command-line options method, but lets
not go there...

CLIPCODE is written entirely in C (not like there's much of it to
write) for speed. Yes, I'm aware that programs like perl and sed
are fine-tuned for processing regular expressions very quickly, and
would do that just as well as CLIPCODE if not better, except that
CLIPCODE only does one thing at a time and then exits, hence
*startup time* is a significant factor. As CLIPCODE is only a couple
of K in size (OK, not counting libPCRE), it can load quite a bit
faster than perl. It probably wouldn't be a great improvement over
sed, I suppose.

File size is around 12K for dynamically linked version, or
40K for statically linked version. By default, only the dynamic
version is built. The static version's handy if space is at an
ABSOLUTE premium (you get so save about 6 K in total...) or you
don't want to/ can't install libPCRE on whatever machine you want
to run clipcode on. If you actually want that, use "make static".

Anyway, being written in C, there's probably some glitches. It
seems to happen a lot, but it's not like I decided "hey, I'll
write some buggy code". It's a tiny program, due to its very
limited functionality, so if there's bugs, they should be
relatively few and easy to find. Let me know, please! If you
know solutions that might not be obvious to me, these would
probably be appreciated.

Hopefully it won't have any bugs that pose security risks. It's not
the sort of program that'd need to be installed SUID root. OK,
perhaps in some situations that might happen, for controlling
some sort of system config file that you wanted ordinary users to
be able to control but not to mess up (so create the file writable
only by root, make a special version of CLIPCODE that might only
have certain operations available such as read and write, and make
it SUID root). But I can't imagine what sort of use you'd actually
*have* for something like that... So no, I don't think any bug in
it could be a risk unless you do something very unwise with it.
But let me know if you think of something.

CLIPCODE is a working title. In future, I hope to find a better
name for it, and then package it off separately from MMSS for
general usage. See
http://www.angelfire.com/super2/duologue/software/unnamed.html
for details.

Oh yeah. For pretty thorough usage info, see the man page:
    man ./clipcode.1

There's a couple of little example config files in this
directory for you to play with:
 new.cfg   null.cfg   sample.config
note that the file extensions are quite arbitrary (and optional)
in full unix tradition. There's some backup copies in the files
 new.cfg.ORIG  null.cfg.ORIG and  sample.config.ORIG
so you can copy the old contents back after you change stuff, and
do  diff new.cfg*   for example, to see what changes have been
made by your commands. Have fun...

Tom Barnes-Lawrence, February 2004

