
                           utok - Unique TOKens 1.5
                                       
Policy

   Create a product that is useful, artistic, free and, is or contains
   reusable elements. Have fun while working on it.
   
Availability

   The latest version should be available at
   [1]http://www.catch22.com/~sven/software/utok.tar.gz.
   
Description

   utok, Unique TOKens, takes a list of arguments with delimiters and
   reject all duplicate entries. Here is a example using MANPATH:
   
$ echo $MANPATH
/usr/man:/usr/local/man
$ MANPATH=`utok $HOME/local/man /usr/local/man $MANPATH /usr/openwin/man`
$ export MANPATH
$ echo $MANPATH
/home/sven/local/man:/usr/local/man:/usr/man:/usr/openwin/man

   Even though /usr/local/man was included a second time it is only in
   the MANPATH once, though it is now before the /usr/man entry instead
   of after it.
   
   This version adds the -d option to remove tokens. To remove . from the
   PATH one would do the following:
   
$ echo $PATH
/usr/local/bin:.:/usr/bin:/usr/sbin
$ PATH=`utok -d .: $PATH`
$ echo PATH
/usr/local/bin:/usr/bin:/usr/sbin
$ export PATH

To Do

  Bugs
  
    3. The m4 stuff needs better documentation and testing.
    4. No way to to make a delimiter a part of a token form command line
       (I don't plan on ever fixing this bug, it just here as a note).
    7. Symbols that start with _ should should not start that.
    9. Solaris and IRIX versions of getopt() don't work the same was as
       basic usage of the GNU version.
       
  Requested Features
  
    2. Have a way to to push an element further back in the path. A work
       around of this would be be something like utok `utok a:b:c:d -d b`
       b, which returns: a:c:d:b
    4. Have a function pointer be run if we run out of memory rather then
       just bailing.
    5. I should use some sort of standard way to document this stuff
       other then just HTML files. Brush up by TEXinfo?
    6. Have a way to include multiple -s options. Ken wrote [2]a patch I
       didn't quite like. If I can't think of a better way it might show
       up in a future version. Suggestions are welcome.
    7. Should use autoconf.
    8. Add #ifdef stuff to make more efficient code when not being
       compiled as a shared object.
       
Stuff Done

  Bugs Fixed
  
    1. I never check my malloc() calls. Fixed by Ken Pizzini
       <[3]ken@halcyon.com>.
    2. Null tokens cause core dumps (i.e. typing utok :). Fixed by Ken
       Pizzini & Sven.
    5. utok a:b:c:d: will return a:b:c:d. Same bug as 2.
    6. ./utok -s '' foo bar baz foo bar returns the output of foobarbaz.
       Fixed when bug 2 was fixed.
    8. Multiple NULL arguments arn't rejected. Fixed by Ken.
   10. utok -? returning %s when it should be returning value in argv[0].
       Fixed.
       
  Features Added
  
    1. Have a way to reject elements. Added by Ken Pizzini.
    3. Make token stuff to be albe used as a shared object. Added by
       Sven.
       
Feedback

   Comments or bug reports/fixes go to Sven Heinicke <sven@zen.org>.
     _________________________________________________________________
   
   
    Copyright  1998 [4]Sven Heinicke <[5]sven@zen.org>

References

   1. http://www.catch22.com/~sven/software/utok.tar.gz
   2. file://localhost/home4/sheinick/local/src/utok-1.5/patch/feature6.txt
   3. mailto:ken@halcyon.com
   4. http://www.zen.org/
   5. mailto:sven@zen.org
