diff --git a/shell/kd b/shell/kd index f7357c6..9de040a 100755 --- a/shell/kd +++ b/shell/kd @@ -25,7 +25,7 @@ function kd() { fi if [[ $# -eq 1 ]]; then local target - target="$(grep -e "^$1" "$conf" | awk '{ print $2 }' | tail -1)" + target="$(awk "\$1 = /^${1}/ {a=\$2}; END { if (a) {print a}}" "$conf")" if [[ -n "$target" ]]; then if [[ -t 1 ]]; then cd "$target" || return 1