From dace118a1e69f29c88ef7e6a6f1f058359afdb72 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 18 Nov 2013 00:43:16 +0900 Subject: [PATCH] remove dead codes --- shrc | 91 ++++-------------------------------------------------------- 1 file changed, 6 insertions(+), 85 deletions(-) diff --git a/shrc b/shrc index 9ac2b87..faf44a4 100755 --- a/shrc +++ b/shrc @@ -544,38 +544,6 @@ netwait(){ echo network works. } -cd(){ - if test $# -eq 0 - then - pushd ~/ >/dev/null - elif test "$1" = - - then - local pwd="$PWD" - command cd "$OLDPWD" - pushd -n "$pwd" >/dev/null # stack last dir - elif ! test -d "$1" - then - echo `basename ${SHELL}`: cd: "$1": No such file or directory 1>&2 - return 1 - else - pushd "$1" >/dev/null - fi - __dirs_rm_dup "$PWD" - echo "$PWD" -} - -__dirs_rm_dup(){ - for d in "$@" - do - local next="$(__realpath --strip "$d")" - for l in $(\dirs -v -l | cut -d $'\n' -f 2- | \ - \grep -x " *[0-9]\+ \+${next}" | \grep -o "^ *[0-9]\+ " | tac) - do - popd +$l -n >/dev/null - done - done -} - __realpath(){ if type realpath >/dev/null 2>&1 then @@ -585,49 +553,19 @@ __realpath(){ do shift done - local d="$OLDPWD" - command cd "$1" - echo "$PWD" - command cd "$d" + (command cd "$d" && echo "$PWD") + # local d="$OLDPWD" + # command cd "$1" + # echo "$PWD" + # command cd "$d" fi } -dh(){ - if test $# -eq 0 - then - dirs -v -l - else - local dir="$(dirs -v -l | \grep "^ *$1 \+" | sed "s/^ *[0-9]* *//g")" - cd "$dir" - fi -} -input(){ - local foo - stty -echo - read foo - stty echo - echo $foo -} - -# tmux(){ -# if test $# -eq 0 -# then -# (cd ~; command tmux start;) -# if command tmux has -t main -# then -# command tmux attach -t main -# else -# (cd ~; command tmux new -s main;) -# fi -# else -# command tmux "$@" -# fi -# } tx(){ if test $# -eq 0 then + echo ":: tx to attach." tmux ls - echo "tx to attach." elif tmux has -t "$1" then tmux attach -t "$1" @@ -925,23 +863,6 @@ convmv_sjis2utf8_notest(){ convmv -r -f sjis -t utf8 * --notest } -winln(){ - # for windose make link (actually junction) - if test $# -eq 0 - then - { - echo "usage: winln TARGET LINK_NAME" - echo "Create a link to TARGET with the name LINK_NAME \ -(that is, TARGET must already exist)." - echo "About other features run 'junction'." - } 1>&2 - return 1 - else - junction "$2" "$1" - fi -} - - ################################################# ## pastebin services