From 9b01e90bbc1384e9cba706c20c90a369002efdb6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 9 Sep 2012 23:30:44 +0900 Subject: [PATCH 1/5] fix cd --- bashrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bashrc b/bashrc index e047263..0faafc7 100755 --- a/bashrc +++ b/bashrc @@ -216,15 +216,15 @@ cd(){ if test $# -eq 0 then pushd ~/ >/dev/null - elif ! test -d "$1" - then - echo `basename ${SHELL}`: cd: "$1": No such file or directory 2>&1 - return 1 elif test $1 = - then local pwd="$PWD" popd >/dev/null pushd -n "$pwd" >/dev/null # stack last dir + elif ! test -d "$1" + then + echo `basename ${SHELL}`: cd: "$1": No such file or directory 2>&1 + return 1 else pushd "$1" >/dev/null fi From 9d94c2050dd350866454aaf980a36019699bc4d7 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 9 Sep 2012 23:32:21 +0900 Subject: [PATCH 2/5] fix cd --- bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 0faafc7..91e198c 100755 --- a/bashrc +++ b/bashrc @@ -220,7 +220,7 @@ cd(){ then local pwd="$PWD" popd >/dev/null - pushd -n "$pwd" >/dev/null # stack last dir + command pushd -n "$pwd" >/dev/null # stack last dir elif ! test -d "$1" then echo `basename ${SHELL}`: cd: "$1": No such file or directory 2>&1 From bf0f9c30ed20be3e485bc65fabc24de423ba1bb9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 9 Sep 2012 23:34:35 +0900 Subject: [PATCH 3/5] fix cd --- bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 91e198c..308d191 100755 --- a/bashrc +++ b/bashrc @@ -220,7 +220,7 @@ cd(){ then local pwd="$PWD" popd >/dev/null - command pushd -n "$pwd" >/dev/null # stack last dir + pushd "$pwd" -n >/dev/null # stack last dir elif ! test -d "$1" then echo `basename ${SHELL}`: cd: "$1": No such file or directory 2>&1 From 438bb68289098c53c1a2eb6b6aebb59159cb18df Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 9 Sep 2012 23:37:32 +0900 Subject: [PATCH 4/5] fix cd --- bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 308d191..4a6a3bf 100755 --- a/bashrc +++ b/bashrc @@ -238,7 +238,7 @@ pushd(){ test $l -eq 0 && continue popd +$l -n done - command pushd "$1" >/dev/null + command pushd "$@" >/dev/null } input(){ From 57b17036aa90f3abc8d27c4233449d30e198f341 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 10 Sep 2012 00:02:09 +0900 Subject: [PATCH 5/5] temporary fix --- bashrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 4a6a3bf..de5d69f 100755 --- a/bashrc +++ b/bashrc @@ -219,8 +219,9 @@ cd(){ elif test $1 = - then local pwd="$PWD" - popd >/dev/null - pushd "$pwd" -n >/dev/null # stack last dir + echo $OLDPWD + command cd $OLDPWD + command pushd -n "$pwd" >/dev/null # stack last dir elif ! test -d "$1" then echo `basename ${SHELL}`: cd: "$1": No such file or directory 2>&1