Browse Source

rm duplicate item when pushd

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

+ 14
- 13
bashrc View File

@@ -187,6 +187,7 @@ null type pacmatic && {
null type apt-get && \
alias aupgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes"
null type port && \
alias port="port -v"
alias pupgrade="sudo port -v selfupdate && { sudo port -v upgrade outdated; sudo port -v uninstall leaves; }"

if iscygwin; then
@@ -214,27 +215,27 @@ netwait(){
cd(){
if test $# -eq 0
then
pushd ~/
pushd ~/ >/dev/null
elif test $1 = -
then
local pwd="$PWD"
popd >/dev/null
pushd -n "$pwd" # stack last dir
pushd -n "$pwd" >/dev/null # stack last dir
else
pushd "$@"
pushd "$@" >/dev/null
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
# }
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(){
local foo


Loading…
Cancel
Save