From d027d082cded59fd7116173c8e1f57791078d5f7 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 31 Aug 2012 18:52:07 +0900 Subject: [PATCH] cd use pushd --- bashrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bashrc b/bashrc index f347041..4e7942c 100755 --- a/bashrc +++ b/bashrc @@ -202,6 +202,20 @@ then || complete -o default -o nospace -F _git g fi +cd(){ + if test $# -eq 0 + then + pushd ~/ + elif test $1 = - + then + local pwd="$PWD" + popd + pushd -n "$pwd" # stack last dir + else + pushd "$@" + fi +} + input(){ local foo stty -echo