Advertisement
luisascoobydoo

bashrc

Jan 25th, 2017
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. #=============================================================================
  2. # Sets up a 2 line prompt containg the hostname, username, and cwd
  3. #
  4. # Usage: setprompt
  5. # Ex: bash$ setprompt
  6. #
  7. #=============================================================================
  8. function setprompt
  9. {
  10.  
  11. green='\e[0;32m\]'
  12. white='\e[1;37m\]'
  13. grey='\e[0;37m\]'
  14. YELLOW='\e[1;33m\]'
  15. RED='\e[1;31m\]'
  16. BLUE='\e[1;34m\]'
  17. NC='\e[0m\]'
  18. MAGENTA='\e[1;35m\]'
  19.  
  20.  
  21. # Define some colors first:
  22. # BLACK='\e[1;30m\1'
  23. # RED='\e[1;31m\1'
  24. # GREEN='\e[1;32m\1'
  25. # YELLOW='\e[1;33m\1'
  26. # BLUE='\e[1;34m\1'
  27. # MAGENTA='\e[1;35m\1'
  28. # CYAN='\e[1;36m\1'
  29. # WHITE='\e[1;37m\1'
  30. # NC='\e[0m\l' # No Color
  31.  
  32. #BACKGROUND
  33. # BG_BLACK='\e[1;40m\1'
  34. # BG_RED='\e[1;41m\1'
  35. # BG_GREEN='\e[1;42m\1'
  36. # BG_YELLOW='\e[1;43m\1'
  37. # BG_BLUE='\e[1;44m\1'
  38. # BG_MAGENTA='\e[1;45m\1'
  39. # BG_CYAN='\e[1;46m\1'
  40. # BG_WHITE='\e[1;47m\1'
  41.  
  42. case `basename $SHELL` in
  43. bash)
  44. #Setup prompt
  45. # \u=username
  46. # \@ time
  47. # \w=full pwd
  48. # \h=hostname (short)
  49. #PS1="${BLUE}[\u@\h]${NC}${RED}[\@]${NC} ${GREEN}[\w]${NC}\n${CYAN}\$ ${NC}"
  50. PS1="${green} [\u@\h \w][\@]\$"
  51. #{RED}[\@$]${MAGENTA}\w${NC} \$\n $ "
  52. #export PS1="${green}[${white}\u${RED}@${YELLOW}\h ${grey}\w${green}]${white} "
  53.  
  54. ;;
  55. ksh)
  56. HOSTNAME=`uname -n`
  57. # PS1="[${LOGNAME}@${HOSTNAME}][\$PWD]
  58. #\$ "
  59. PS1="[${LOGNAME}@${HOSTNAME}]"
  60. ;;
  61. *)
  62. PS1="\$"
  63. ;;
  64. esac
  65.  
  66. export PS1
  67.  
  68. }
  69.  
  70. setprompt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement