Browse Source

add pushd func as comment

pull/1/head
10sr 12 years ago
parent
commit
f126f4931b
1 changed files with 14 additions and 2 deletions
  1. +14
    -2
      bashrc

+ 14
- 2
bashrc View File

@@ -117,7 +117,8 @@ alias mv="mv -v"
alias psaux="ps auxww" alias psaux="ps auxww"
alias q=exit alias q=exit
alias e3=e3em alias e3=e3em
alias dirs="dirs -v -l | \grep -v \$(printf '%s$' \$PWD)"
#alias dirs="dirs -v -l | \grep -v \$(printf '%s$' \$PWD)"
alias dirs="dirs -v -l"
alias po=popd alias po=popd
alias pu=pushd alias pu=pushd
alias sudo="sudo " # use aliases through sudo alias sudo="sudo " # use aliases through sudo
@@ -209,13 +210,24 @@ cd(){
elif test $1 = - elif test $1 = -
then then
local pwd="$PWD" local pwd="$PWD"
popd
popd >/dev/null
pushd -n "$pwd" # stack last dir pushd -n "$pwd" # stack last dir
else else
pushd "$@" pushd "$@"
fi fi
} }


# pushd(){
# local pwd="$PWD"
# for l in $(\dirs -v -l | \grep "^ [0-9]\+ ${pwd}$" | cut -d " " -f 2 | tac)
# do
# echo $l
# test $l -eq 0 && continue
# popd +$l -n
# done
# command pushd "$@" >/dev/null
# }

input(){ input(){
local foo local foo
stty -echo stty -echo


Loading…
Cancel
Save