标签:code rom 解决 histfile prompt echo .bashrc print int
history(){
syncHistory
builtin history "$@"
}
syncHistory(){
builtin history -a
HISTFILESIZE=$HISTFILESIZE
builtin history -c
builtin history -r
}
promptCommand(){
if [ "$TERM" = xterm ]
then case "$DISPLAY" in
:*) printf "\033]0;%s\007" "$PWD" ;;
*) printf "\033]0;%s -- %s\007" "$HOST_UPPER" "$PWD" ;;
esac
fi
syncHistory
}
HOST_UPPER=`echo $HOSTNAME | tr ‘[a-z]‘ ‘[A-Z]‘`
PROMPT_COMMAND=promptCommand
贴在.bashrc即可
标签:code rom 解决 histfile prompt echo .bashrc print int
原文地址:http://blog.51cto.com/swiki/2342044