Browse Source

shrc: avoid multiple source

pull/1/head
10sr 10 years ago
parent
commit
f87d82f0fd
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      shrc

+ 10
- 3
shrc View File

@@ -2,6 +2,13 @@


expr "$-" : '^.*i' >/dev/null || return expr "$-" : '^.*i' >/dev/null || return


##########################################

__shrc_lock=/tmp/shrc_lock.$USER.$$
test -f "$__shrc_lock" && return
touch "$__shrc_lock"


########################################## ##########################################
null(){ null(){
"$@" >/dev/null 2>&1 "$@" >/dev/null 2>&1
@@ -368,12 +375,12 @@ __safe_alias ipy2=ipython2
# SHELL is set to be /bin/zsh # SHELL is set to be /bin/zsh
if $inbash if $inbash
then then
alias _reloadrc="exec bash"
alias _reloadrc="rm '$__shrc_lock'; exec bash"
elif $inzsh elif $inzsh
then then
alias _reloadrc="exec zsh"
alias _reloadrc="rm '$__shrc_lock'; exec zsh"
else else
alias _reloadrc="exec $SHELL"
alias _reloadrc="rm '$__shrc_lock'; exec $SHELL"
fi fi
# alias mytime="date +%Y%m%d-%H%M%S" # alias mytime="date +%Y%m%d-%H%M%S"
alias sh="ENV=$HOME/.shrc PS1=\$\ PROMPT_COMMAND="" sh" alias sh="ENV=$HOME/.shrc PS1=\$\ PROMPT_COMMAND="" sh"


Loading…
Cancel
Save