ajout de uinstpathf()

This commit is contained in:
Jephte CLAIN 2013-11-27 00:54:12 +04:00
parent cb27e57d7f
commit 0f3b925527
2 changed files with 6 additions and 1 deletions

View File

@ -1 +1 @@
10
11

View File

@ -811,6 +811,11 @@ function uinspath() {
local _qdir="${1//\//\\/}"
eval "export ${2:-PATH}; "'[ "${'"${2:-PATH}"'#$1:}" == "$'"${2:-PATH}"'" -a "${'"${2:-PATH}"'%:$1}" == "$'"${2:-PATH}"'" -a "${'"${2:-PATH}"'//:$_qdir:/:}" == "$'"${2:-PATH}"'" -a "$'"${2:-PATH}"'" != "$1" ] && '"${2:-PATH}"'="$1${'"${2:-PATH}"':+:$'"${2:-PATH}"'}"'
}
function uinspathf() {
# S'assurer que le chemin $1 soit au début de $2(=PATH)
udelpath "$@"
uinstpath "$@"
}
function withpath() {
# tester si le chemin est relatif à . ou à .., ou est absolu. i.e 'withpath a/b'