uniqpath
Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 05 August 2008
Index
Return to Main Contents
NAME
uniqpath - remove duplicates in colon separated strings ($PATH)
SYNOPSIS
edrc/lib/uniqpath
[
-h
]
uniqpath string
AVAILABILITY
WA2L/edrc
DESCRIPTION
The main purpose of
uniqpath
is to remove duplicates in a colon separated strings as known
from the command path (
$PATH
) or manual path (
$MANPATH
).
The order of the elements remains, but duplicates are removed
from the list.
Therefore
'
uniqpath a:b:c:b:c
'
returns
a:b:c.
OPTIONS
- -h
-
usage message.
- string
-
colon separated string as known from the command path (
$PATH
).
ENVIRONMENT
-
EXIT STATUS
- 0
-
no error.
- 4
-
usage listed.
FILES
-
EXAMPLES
- 1) usage of uniqpath in a script
-
The following cut-out is from a Born shell script. The usage is to
tidy up the command path:
:
:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/lbin:$PATH
export PATH
Scriptname=`basename $0`
Scriptpath=`dirname $0`
Basedir=`$Scriptpath/../lib/approot`
:
:
PATH=`$Basedir/lib/uniqpath $Basedir/bin:$Basedir/lib:$PATH`
export PATH
:
:
SEE ALSO
edrcintro(1),
sh(1),
ksh(1),
bash(1)
NOTES
-
BUGS
-
AUTHOR
uniqpath was developed by Christian Walther. Send suggestions
and bug reports to wa2l@users.sourceforge.net .
COPYRIGHT
Copyright © 2008
Christian Walther
This is free software; see
edrc/doc/COPYING
for copying conditions. There is ABSOLUTELY NO WARRANTY; not
even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This document was created by man2html
using the manual pages.
Time: 16:54:53 GMT, August 28, 2024