rendre ppath() plus résistant
This commit is contained in:
parent
c9ce115f78
commit
8143452c1b
|
@ -637,8 +637,8 @@ function ppath() {
|
||||||
[ -n "$cwd" ] || cwd="$(pwd)"
|
[ -n "$cwd" ] || cwd="$(pwd)"
|
||||||
|
|
||||||
[ "$path" = "$cwd" ] && path="."
|
[ "$path" = "$cwd" ] && path="."
|
||||||
[ "$cwd" != "/" -a "$cwd" != "$HOME" ] && path="${path/#$cwd\//}"
|
[ "$cwd" != "/" -a "$cwd" != "$HOME" ] && path="${path#$cwd/}"
|
||||||
path="${path/#$HOME/~}"
|
[ "${path#$HOME/}" != "$path" ] && path="~${path#$HOME}"
|
||||||
|
|
||||||
rawecho "$path"
|
rawecho "$path"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue