profile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ##
  2. ## @l_prefix@/etc/bash/profile -- Global Bash Profile
  3. ##
  4. # welcome and goodbye message ;)
  5. echo "$HOSTNAME: user $USER, login at `date`"
  6. trap 'echo "$HOSTNAME: user $USER, logout at `date`"' 0
  7. # initially adjust $PWD to symbolic path
  8. cd $HOME
  9. # provide user and host information in default prompt
  10. PS1="\u@\h\$ "
  11. # session timeout
  12. export TMOUT=3600
  13. # environment permissions
  14. umask 022
  15. ulimit -c 16384
  16. if expr $- : ".*i.*" >/dev/null; then
  17. mesg y
  18. fi
  19. # history functionality
  20. shopt -s histappend
  21. HISTSIZE=100
  22. HISTFILESIZE=100
  23. alias h='history | $PAGER'
  24. # various additional variables
  25. export TMPDIR=/tmp
  26. export TEMPDIR=$TMPDIR
  27. export BLOCKSIZE=1024
  28. # convinient root priviledge switching
  29. root () {
  30. if [ $# -eq 0 -o ".$1" = ".-i" ]; then
  31. ssh -t -x root@localhost cd $PWD \&\& exec ${SHELL-/bin/sh}
  32. elif [ ".$1" = ".-l" ]; then
  33. ssh -x root@localhost cd $PWD \&\& `history | tail -2 | head -1 | cut -c8-`
  34. elif [ ".$1" = ".-t" ]; then
  35. shift
  36. ssh -t -x root@localhost cd $PWD \&\& "$@"
  37. else
  38. ssh -x root@localhost cd $PWD \&\& "$@"
  39. fi
  40. }
  41. # suck in the Bourne-Shell environment of all OpenPKG packages
  42. eval `@l_prefix@/etc/rc -p all env:sh`
  43. # path to user environment init script
  44. if [ -f "$HOME/.bashrc" ]; then
  45. BASH_ENV=$HOME/.bashrc
  46. . $BASH_ENV
  47. fi