| @@ -234,7 +234,7 @@ cd(){ | |||||
| __dirs_rm_dup(){ | __dirs_rm_dup(){ | ||||
| for d in "$@" | for d in "$@" | ||||
| do | do | ||||
| local next="$(realpath --strip "$d")" | |||||
| local next="$(__realpath --strip "$d")" | |||||
| for l in $(\dirs -v -l | cut -d " | for l in $(\dirs -v -l | cut -d " | ||||
| " -f 2- | \grep -x " *[0-9]\+ \+${next}" | \grep -o "^ *[0-9]\+ " | tac) | " -f 2- | \grep -x " *[0-9]\+ \+${next}" | \grep -o "^ *[0-9]\+ " | tac) | ||||
| do | do | ||||
| @@ -243,6 +243,22 @@ __dirs_rm_dup(){ | |||||
| done | done | ||||
| } | } | ||||
| __realpath(){ | |||||
| if type realpath >/dev/null 2>&1 | |||||
| then | |||||
| command realpath "$@" | |||||
| else | |||||
| while ! test -d $1 | |||||
| do | |||||
| shift | |||||
| done | |||||
| local d="$OLDPWD" | |||||
| command cd "$1" | |||||
| echo "$PWD" | |||||
| command cd "$d" | |||||
| fi | |||||
| } | |||||
| dh(){ | dh(){ | ||||
| if test $# -eq 0 | if test $# -eq 0 | ||||
| then | then | ||||