From: Sven Heinicke <sven@zen.org>
Subject: utok 1.5 - Unique TOKens
Date: Fri, 6 Mar 1998 09:20:25 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Availability
The latest version should be available at
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
Stuff Done
Bugs Fixed Since Version 1.1
1. I never check my malloc() calls. Fixed by Ken Pizzini
<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 Since Version 1.1
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.
- --
Sven Heinicke <sven@zen.org>
http://www.zen.org/~sven/
- --
This article has been digitally signed by the moderator, using PGP.
http://www.iki.fi/mjr/cola-public-key.asc has PGP key for validating signature.
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember a short description of the software and the LOCATION.
This group is archived at http://www.iki.fi/liw/linux/cola.html
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
iQCVAgUBNP+/2lrUI/eHXJZ5AQH3kwQAllQ5GeR/S9H9Rw6X0oZglRQFfJQVk58q
ygmyUWeKfFctyP3d/Ms2mZd1zjK0/kxUPHVdO2wZyMmgFIlQht2Na3Mv//wsKG6a
GHLP3sr9iDk4pbyRU9vV405BMAQjwa+cO7AAlyDIGx6hnvjP6xzNa5+biV2eMf9y
fe5e2FRPX/M=
=E2JA
-----END PGP SIGNATURE-----