标签:active || file hat xdg orm custom rac tom
1 # Setup a red prompt for root and a green one for users. 2 # rename this file to color_prompt.sh to actually enable it 3 NORMAL="\[\e[0m\]" 4 RED="\[\e[1;31m\]" 5 GREEN="\[\e[1;32m\]" 6 if [ "$USER" = root ]; then 7 PS1="$RED\h [$NORMAL\w$RED]# $NORMAL" 8 else 9 PS1="$GREEN\h [$NORMAL\w$GREEN]\$ $NORMAL" 10 fi 11 12 13 # Check for interactive bash and that we haven‘t already been sourced. 14 if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then 15 16 # Check for recent enough version of bash. 17 if [ ${BASH_VERSINFO[0]} -gt 4 ] || 18 [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then 19 [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && 20 . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" 21 if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then 22 # Source completion code. 23 . /usr/share/bash-completion/bash_completion 24 fi 25 fi 26 27 fi
标签:active || file hat xdg orm custom rac tom
原文地址:https://www.cnblogs.com/petersonx/p/12106239.html