bashrc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Begin /etc/bashrc
  2. # Written for Beyond Linux From Scratch
  3. # by James Robertson <jameswrobertson@earthlink.net>
  4. # updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>
  5. # System wide aliases and functions.
  6. # System wide environment variables and startup programs should go into
  7. # /etc/profile. Personal environment variables and startup programs
  8. # should go into ~/.bash_profile. Personal aliases and functions should
  9. # go into ~/.bashrc
  10. # Provides a colored /bin/ls command. Used in conjunction with code in
  11. # /etc/profile.
  12. alias ls='ls --color=auto'
  13. # Provides prompt for non-login shells, specifically shells started
  14. # in the X environment. [Review the LFS archive thread titled
  15. # PS1 Environment Variable for a great case study behind this script
  16. # addendum.]
  17. export LC_ALL="tr_TR.UTF-8"
  18. NORMAL="\[\e[0m\]"
  19. RED="\[\e[1;31m\]"
  20. GREEN="\[\e[1;32m\]"
  21. WHITE="\[\e[1;37m\]"
  22. case $TERM in
  23. xterm|rxvt*)
  24. TITLEBAR='\[\033]0;\u@\h \007\]'
  25. ;;
  26. *)
  27. TITLEBAR=''
  28. ;;
  29. esac
  30. if [[ $EUID == 0 ]] ; then
  31. PS1="$TITLEBAR$RED\u [ $NORMAL\w$RED ]# $NORMAL"
  32. else
  33. PS1="$TITLEBAR$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
  34. fi
  35. # End /etc/bashrc