简单实用程序,用于删除重复的和操作类似于路径的环境变量(例如,ld_library_path,manpath)。
uniquepath的Python项目详细描述
一个简单的实用程序,用于删除类似路径的重复环境变量。
在unix上,它输出转换后的变量,因此可以如下使用:
$ PATH=`uniquepath.py PATH`
在windows上,有一个助手.bat脚本可以实现相同的效果(即使它不是显式的):
C:\uniquepath.bat PATH
命令行还提供了附加、预处理和删除变量路径的方法,并且它支持通配符(用于删除)。
用法
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.
目录pyenv.bat(切换python版本)和windows的助手脚本uniquepath.bat中也有两个使用示例。
安装
从http://github.com/elmotec/uniquepath下载uniquepath.py
许可证
根据MIT License条款授权。请参阅文件许可证。