码迷,mamicode.com
首页 > 其他好文 > 详细

bash customized

时间:2019-12-27 11:45:52      阅读:91      评论:0      收藏:0      [点我收藏+]

标签: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 havent 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

bash customized

标签:active   ||   file   hat   xdg   orm   custom   rac   tom   

原文地址:https://www.cnblogs.com/petersonx/p/12106239.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!