Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=============================================================================
- # Sets up a 2 line prompt containg the hostname, username, and cwd
- #
- # Usage: setprompt
- # Ex: bash$ setprompt
- #
- #=============================================================================
- function setprompt
- {
- green='\e[0;32m\]'
- white='\e[1;37m\]'
- grey='\e[0;37m\]'
- YELLOW='\e[1;33m\]'
- RED='\e[1;31m\]'
- BLUE='\e[1;34m\]'
- NC='\e[0m\]'
- MAGENTA='\e[1;35m\]'
- # Define some colors first:
- # BLACK='\e[1;30m\1'
- # RED='\e[1;31m\1'
- # GREEN='\e[1;32m\1'
- # YELLOW='\e[1;33m\1'
- # BLUE='\e[1;34m\1'
- # MAGENTA='\e[1;35m\1'
- # CYAN='\e[1;36m\1'
- # WHITE='\e[1;37m\1'
- # NC='\e[0m\l' # No Color
- #BACKGROUND
- # BG_BLACK='\e[1;40m\1'
- # BG_RED='\e[1;41m\1'
- # BG_GREEN='\e[1;42m\1'
- # BG_YELLOW='\e[1;43m\1'
- # BG_BLUE='\e[1;44m\1'
- # BG_MAGENTA='\e[1;45m\1'
- # BG_CYAN='\e[1;46m\1'
- # BG_WHITE='\e[1;47m\1'
- case `basename $SHELL` in
- bash)
- #Setup prompt
- # \u=username
- # \@ time
- # \w=full pwd
- # \h=hostname (short)
- #PS1="${BLUE}[\u@\h]${NC}${RED}[\@]${NC} ${GREEN}[\w]${NC}\n${CYAN}\$ ${NC}"
- PS1="${green} [\u@\h \w][\@]\$"
- #{RED}[\@$]${MAGENTA}\w${NC} \$\n $ "
- #export PS1="${green}[${white}\u${RED}@${YELLOW}\h ${grey}\w${green}]${white} "
- ;;
- ksh)
- HOSTNAME=`uname -n`
- # PS1="[${LOGNAME}@${HOSTNAME}][\$PWD]
- #\$ "
- PS1="[${LOGNAME}@${HOSTNAME}]"
- ;;
- *)
- PS1="\$"
- ;;
- esac
- export PS1
- }
- setprompt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement