home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World Interactive 1996 May / PCW_MAY_1996_LINUX_UKUUG.ISO / etc / profile < prev    next >
Text File  |  1995-03-03  |  3KB  |  111 lines

  1. # /etc/profile
  2. # Commands to execute each time someone logs in in a bourne shell
  3. # Note that login initializes environment variables from /etc/ENVIRONMENT.
  4. #
  5. #IFS='     
  6. #'
  7. #set -x
  8. #echo "TERM=${TERM-}"
  9. trap exit 15
  10. umask 0022
  11. if [ -z "${SHELL-unset}" ]; then
  12.   SHELL=/bin/sh; export SHELL
  13. fi
  14.  
  15. alias which=type
  16. alias cd..="cd .."
  17. # PWD may be set by ksh and is not maintained by sh.
  18. # Unset it and create it as local variable
  19. unset PWD; cd .
  20.  
  21. case "${TERM-}" in
  22.   @*@*)
  23.     case "${DISPLAY-}" in
  24.       '')
  25.     DISPLAY="`echo "$TERM" | /bin/sed 's/@[^@]*@\(.*\)/\1/'`"; export DISPLAY
  26.     WINDOWID="`echo "$TERM" | /bin/sed 's/@\([^@]*\)@.*/\1/'`"; export WINDOWID
  27.     ;;
  28.     esac
  29.     unset TERM
  30.     ;;
  31.   *@*@*)
  32.     case "${DISPLAY-}" in
  33.       '')
  34.     DISPLAY="`echo "$TERM" | /bin/sed 's/[^@]*@[^@]*@\(.*\)/\1/'`"; export DISPLAY
  35.     WINDOWID="`echo "$TERM" | /bin/sed 's/[^@]*@\([^@]*\)@.*/\1/'`"; export WINDOWID
  36.     ;;
  37.     esac
  38.     TERM="`echo "$TERM" | /bin/sed 's/@.*//'`"; export TERM
  39.     ;;
  40.   @*)
  41.     case "${DISPLAY-}" in
  42.       '') DISPLAY="`echo "$TERM" | /bin/sed 's/@//'`"; export DISPLAY;;
  43.     esac
  44.     unset TERM
  45.     ;;
  46.   *@*)
  47.     case "${DISPLAY-}" in
  48.       '') DISPLAY="`echo "$TERM" | /bin/sed 's/[^@]*@//'`"; export DISPLAY;;
  49.     esac
  50.     TERM="`echo "$TERM" | /bin/sed 's/@.*//'`"; export TERM
  51.     ;;
  52. esac
  53. TERM="`/bin/tsetup`"; export TERM
  54. case "${PATH-}" in \~/bin|*:\~/bin|\~/bin:*|*:\~/bin:*) :;; *)
  55.     PATH="${PATH%:.}:~/bin:."; export PATH
  56. esac
  57. CDPATH=".:~"; export CDPATH
  58. LESS=-MM; export LESS
  59. PGPPATH="${HOME%/}/.pgp"; export PGPPATH
  60. tmp="${tmp:-/var/tmp/$$}"
  61.  
  62. #
  63. #  Set EMACS editing mode (only for ksh); We cannot use "set -o emacs" because
  64. #  /bin/sh would not like it, and if we would not export the EDITOR environment
  65. #  variable, line editing would stop after forking another ksh.
  66. #
  67. if [ -z "${EDITOR-}" ]; then
  68.     EDITOR=emacs
  69. fi
  70. case "${TERM-}" in
  71.     xterm*) PS1=']0;\u@\h:\w\$ ';;
  72.     *) PS1='\u@\h:\w \$ ';;
  73. esac
  74. case "${TERM-}" in
  75.     console|con80x25) MINICOM="-l -con -tminicom-$TERM"; export MINICOM;;
  76. esac
  77. e()
  78. {
  79.     case $# in
  80.         0)    echo "\$ ${VISUAL-${EDITOR-emacs}} ${efile-}"
  81.             ${VISUAL-${EDITOR-emacs}} ${efile-};;
  82.         *)    efile="$@"; ${VISUAL-${EDITOR-emacs}} "$@";;
  83.     esac
  84. }
  85. setenv()
  86. {
  87.     case $# in
  88.         2)    eval "$1=$2"; export "$1";;
  89.         *)    echo "usage: setenv <EN_VAR> <Value>" >&2; return 1;;
  90.     esac
  91. }
  92. unsetenv()
  93. {
  94.     unset ${@+"$@"}
  95. }
  96. rehash()
  97. {
  98.     hash -r
  99. }
  100. limit()
  101. {
  102.     echo 'Use ulimit to set process limits; type "help ulimit" for help.'>&2
  103.     return 1
  104. }
  105. unlimit()
  106. {
  107.     echo 'Use ulimit to set process limits; type "help ulimit" for help.'>&2
  108.     return 1
  109. }
  110. trap 15
  111.