diff --git a/setup.sh b/setup.sh index 9083e6e..31a3a85 100755 --- a/setup.sh +++ b/setup.sh @@ -22,6 +22,7 @@ gen_common(){ __iswindows=false __isdarwin=false __islinux=false + # $OSTYPE is another choice. which is better? case `uname` in (MINGW*) __ismsys=true ;; (CYGWIN*) __iscygwin=true ;; diff --git a/shrc b/shrc index e3c82d0..6130c3a 100755 --- a/shrc +++ b/shrc @@ -329,7 +329,14 @@ __safe_alias pc="sudo \paco -D" alias pycalc="python -i -c 'from math import *' " __safe_alias py3=python3 __safe_alias py2=python2 -alias _reloadrc="exec \"$SHELL\"" +# SHELL cannot be used. for example, run bash inside zsh, SHELL is set to be +# /bin/zsh +if $inbash +then + alias _reloadrc="exec bash" +elif $inzsh + alias _reloadrc="exec zsh" +fi # alias mytime="date +%Y%m%d-%H%M%S" alias sh="ENV=$HOME/.shrc PS1=\$\ PROMPT_COMMAND="" sh" # type trash >/dev/null 2>&1 && alias rm=trash