Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROMPT_COMMAND=__prompt_command
- __prompt_command() {
- local EXIT="$?"
- PS1=""
- local Reset='\[$(tput sgr0)\]'
- local Gray='\[\033[38;5;7m\]'
- local Green='\[\033[38;5;2m\]'
- local Yellow='\[\033[38;5;3m\]'
- local Blue='\[\033[38;5;12m\]'
- local Cyan='\[\033[38;5;14m\]'
- local Red='\[\033[38;5;9m\]'
- local ExitColor="${Green}"
- local UserColor="${Green}"
- if [ $USER == "root" ]
- then
- UserColor="${Red}"
- fi
- if [ $EXIT != 0 ]
- then
- ExitColor="${Red}"
- fi
- PS1="${Reset}[${UserColor}\u${Yellow}@${Blue}\h ${Cyan}\w${Reset}]${ExitColor}"'\$'"${Reset} "
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement