Skip to main content

Simple utility to remove duplicate and manipulate PATH-like environment variables (e.g. LD_LIBRARY_PATH, MANPATH).

Project description

Simple utility to remove duplicate in PATH-like environment variables.

On Unix, it outputs the transformed variable so it can be used like this :

$ PATH=`uniquepath.py PATH`

On Windows, there is a helper .bat script that achieve the same effect (even if it is not as explicit):

C:\uniquepath.bat PATH

The command line also offers ways to append, prepend, and remove path to the variable and it supports wildcard (usefull for remove).

Usage

usage: uniquepath.py [-h] [-v] [-r PATH] [-a PATH] [-p PATH]
                     [--separator CHAR] [--debug]
                     variable

positional arguments:
  variable              environment variable or variable value to process.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -r PATH, --remove PATH
                        remove value(s) from the environment variable.
  -a PATH, --append PATH
                        append value(s) to the environment variable.
  -p PATH, --prepend PATH
                        prepend value(s) to the environment variable.
  --separator CHAR      changes the path separator (default is os specific).
  --debug               different output format more readable but invalid. DO
                        NOT ASSIGN to an environment variable.

On Windows: use uniquepath.bat helper script.

There are also 2 usage examples in the directory pyenv.bat (to switch python version) and the helper script uniquepath.bat for windows.

Installation

Download uniquepath.py from http://github.com/elmotec/uniquepath

License

Licensed under the term of MIT License. See file LICENSE.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uniquepath-1.0.zip (4.1 kB view details)

Uploaded Source

File details

Details for the file uniquepath-1.0.zip.

File metadata

  • Download URL: uniquepath-1.0.zip
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for uniquepath-1.0.zip
Algorithm Hash digest
SHA256 d6d988d0a85347644672577110af58ab340e35b2d2d523df1e2c5c1fbdf629e7
MD5 5595d63ac180eafd3a97cf3117c267af
BLAKE2b-256 a179ed3d12388103d48d835c4392172844a066cfb4558bb0ad9668cfe2275994

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page