home *** CD-ROM | disk | FTP | other *** search
/ tusportal.tus.k12.pa.us / tusportal.tus.k12.pa.us.tar / tusportal.tus.k12.pa.us / Wyse / latest-image.raw / 0.img / etc / profile < prev    next >
Text File  |  2009-01-08  |  10KB  |  409 lines

  1. # /etc/profile for SuSE Linux
  2. #
  3. # PLEASE DO NOT CHANGE /etc/profile. There are chances that your changes
  4. # will be lost during system upgrades. Instead use /etc/profile.local for
  5. # your local settings, favourite global aliases, VISUAL and EDITOR
  6. # variables, etc ...
  7.  
  8. #
  9. # Check which shell is reading this file
  10. #
  11. if test -f /proc/mounts ; then
  12.   case "`/bin/ls -l /proc/$$/exe`" in
  13.     */bash)    is=bash
  14.     read -t 1 a r </proc/$$/cmdline
  15.     case "$a" in
  16.     sh|-sh|*/sh)
  17.         is=sh    ;;
  18.     esac        ;;
  19.     */ash)    is=ash  ;;
  20.     */ksh)    is=ksh  ;;
  21.     */pdksh)    is=ksh  ;;
  22.     */zsh)    is=zsh  ;;
  23.     */*)    is=sh   ;;
  24.   esac
  25.   #
  26.   # `r' in $- occurs *after* system files are parsed
  27.   #
  28.   for a in $SHELL ; do
  29.     case "$a" in
  30.       */r*sh)
  31.         readonly restricted=true ;;
  32.       -r*|-[!-]r*|-[!-][!-]r*)
  33.         readonly restricted=true ;;
  34.       --restricted)
  35.         readonly restricted=true ;;
  36.     esac
  37.   done
  38.   unset a r
  39. else
  40.   is=sh
  41. fi
  42.  
  43. #
  44. # Call common progams from /bin or /usr/bin only
  45. #
  46. path ()
  47. {
  48.     if test -x /usr/bin/$1 ; then
  49.     ${1+"/usr/bin/$@"}
  50.     elif test -x   /bin/$1 ; then
  51.     ${1+"/bin/$@"}
  52.     fi
  53. }
  54.  
  55. #
  56. # Initialize terminal
  57. #
  58. tty=`path tty 2> /dev/null`
  59. test $? -ne 0 && tty=""
  60. if test -O "$tty" -a -n "$PS1"; then
  61.     test -z "${TERM}"        && { TERM=linux; export TERM; }
  62.     test "${TERM}" = "unknown"    && { TERM=linux; export TERM; }
  63.     # Do not change settings on local line if connected to remote
  64.     if test -z "$SSH_TTY" -a "${TERM}" != "dumb" ; then
  65.     path stty sane cr0 pass8 dec
  66.     path tset -I -Q
  67.     fi
  68.     # on iSeries virtual console, detect screen size and terminal
  69.     if test -d /proc/iSeries -a \( "$tty" = "/dev/tty1" -o "$tty" = "/dev/console" \) ; then
  70.         LINES=24
  71.     COLUMNS=80
  72.     export LINES COLUMNS TERM
  73.         if test -x /bin/initviocons ; then
  74.          eval `/bin/initviocons -q -e`
  75.     fi
  76.     fi
  77. fi
  78. unset TERMCAP
  79.  
  80. #
  81. # Time until a complete key sequence must have arrived
  82. #
  83. #ESCDELAY=2000
  84. #export ESCDELAY
  85.  
  86. #
  87. # The user file-creation mask
  88. #
  89. # The global umask value is stored in /etc/login.defs and
  90. # will be set by pam_umask.so (see "man pam_umask").
  91. #umask 022
  92.  
  93. #
  94. # Setup for gzip and (t)csh users
  95. #
  96. if test -z "$PROFILEREAD" ; then
  97.     # GZIP=-9
  98.     # export GZIP
  99.     CSHEDIT=emacs
  100.     export CSHEDIT
  101. fi
  102.  
  103. #
  104. # ksh/ash sometimes do not know
  105. #
  106. test -z "$UID"  && readonly  UID=`path id -ur 2> /dev/null`
  107. test -z "$EUID" && readonly EUID=`path id -u  2> /dev/null`
  108. test -z "$USER" && USER=`path id -un 2> /dev/null`
  109. test -z "$MAIL" && MAIL=/var/spool/mail/$USER
  110. test -z "$HOST" && HOST=`/bin/uname -n 2> /dev/null`
  111. test -z "$CPU"  &&  CPU=`/bin/uname -m 2> /dev/null`
  112. if test -z "$HOSTNAME" ; then
  113.    HOSTNAME=${HOST}.`cat /proc/sys/kernel/domainname`
  114. fi
  115. test -z "$LOGNAME"  && LOGNAME=$USER
  116. case "$CPU" in
  117.     i?86) HOSTTYPE=i386   ;;
  118.     *)    HOSTTYPE=${CPU} ;;
  119. esac
  120.   OSTYPE=linux
  121. MACHTYPE=${CPU}-suse-${OSTYPE}
  122. # Do NOT export UID, EUID, USER, and LOGNAME
  123. export MAIL HOST CPU HOSTNAME HOSTTYPE OSTYPE MACHTYPE
  124.  
  125. #
  126. # You may use /etc/initscript, /etc/profile.local or the
  127. # ulimit package instead to set up ulimits and your PATH.
  128. #
  129. # if test "$is" != "ash" -a ! -r /etc/initscript; then
  130. #     ulimit -Sc 0        # don't create core files
  131. #     ulimit -Sd $(ulimit -Hd)
  132. #     ulimit -Ss $(ulimit -Hs)
  133. #     ulimit -Sm $(ulimit -Hm)
  134. # fi
  135.  
  136. #
  137. # Make path more comfortable
  138. #
  139. if test -z "$PROFILEREAD" ; then
  140.     PATH=/usr/local/bin:/usr/bin:/bin
  141.     if test "$HOME" != "/" ; then
  142.     for dir in $HOME/bin/$CPU $HOME/bin ; do
  143.         test -d $dir && PATH=$dir:$PATH
  144.     done
  145.     fi
  146.     if test "$UID" = 0 ; then
  147.     test -d /opt/kde3/sbin  && PATH=/opt/kde3/sbin:$PATH
  148.     PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
  149.     fi
  150.     for dir in    /usr/X11/bin \
  151.         /usr/bin/X11 \
  152.         /usr/X11R6/bin \
  153.         /var/lib/dosemu \
  154.         /usr/games \
  155.         /opt/bin \
  156.         /opt/kde3/bin \
  157.         /opt/kde2/bin \
  158.         /opt/kde/bin \
  159.         /usr/openwin/bin \
  160.         /opt/cross/bin
  161.     do
  162.     test -d $dir && PATH=$PATH:$dir
  163.     done
  164.     unset dir
  165.     export PATH
  166. fi
  167.  
  168. #
  169. # Many programs using readline library for line editing
  170. # should know about this (e.g. bash)
  171. #
  172. if test -z "$INPUTRC" ; then
  173.     INPUTRC=/etc/inputrc
  174.     test -s $HOME/.inputrc && INPUTRC=$HOME/.inputrc
  175.     export INPUTRC
  176. fi
  177.  
  178. #
  179. # Most bourn shell clones knows about this
  180. #
  181. if test -z "$PROFILEREAD" ; then
  182.     HISTSIZE=1000
  183.     export HISTSIZE
  184. fi
  185.  
  186. #
  187. # Set some environment variables for TeX/LaTeX (Not used due luatex)
  188. #
  189. #if test -n "$TEXINPUTS" ; then
  190. #    TEXINPUTS=":$TEXINPUTS:$HOME/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX"
  191. #else
  192. #    TEXINPUTS=":$HOME/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX"
  193. #fi
  194. #export TEXINPUTS
  195.  
  196. #
  197. # Configure the default pager on SuSE Linux
  198. #
  199. if test -z "$LESS" -a -x /usr/bin/less ; then
  200.     LESS="-M -I"
  201.     LESSOPEN="lessopen.sh %s"
  202.     LESSCLOSE="lessclose.sh %s %s"
  203.     LESS_ADVANCED_PREPROCESSOR="no"
  204.     if test -s /etc/lesskey.bin ; then
  205.     LESSKEY=/etc/lesskey.bin
  206.     fi
  207.     PAGER=less
  208.     MORE=-sl
  209.     export LESSOPEN LESSCLOSE LESS LESSKEY PAGER LESS_ADVANCED_PREPROCESSOR MORE
  210. fi
  211.  
  212. #
  213. # Minicom 
  214. #
  215. if test -z "$PROFILEREAD" ; then
  216.     MINICOM="-c on"
  217.     export MINICOM
  218. fi
  219.  
  220. #
  221. # Current manpath
  222. #
  223. if test -z "$PROFILEREAD" ; then
  224.     tmp="$MANPATH"
  225.     unset MANPATH
  226.     if test -n "$tmp" ; then
  227.     MANPATH="${tmp}:`test -x /usr/bin/manpath && /usr/bin/manpath -q`"
  228.     else
  229.     MANPATH="`test -x /usr/bin/manpath && /usr/bin/manpath -q`"
  230.     fi
  231.     unset tmp
  232.     export MANPATH
  233. fi
  234.  
  235. #
  236. # Some applications do not handle the XAPPLRESDIR environment properly,
  237. # when it contains more than one directory. More than one directory only
  238. # makes sense if you have a client with /usr mounted via nfs and you want
  239. # to configure applications machine dependent. Uncomment the lines below
  240. # if you want this.
  241. #
  242. #XAPPLRESDIR="$XAPPLRESDIR:/var/X11R6/app-defaults:/usr/X11R6/lib/X11/app-defaults"
  243. #export XAPPLRESDIR
  244.  
  245. #
  246. # Set INFOPATH to tell xemacs where he can find the info files
  247. #
  248. if test -z "$PROFILEREAD" ; then
  249.     tmp="$INFODIR"
  250.     if test -n "$tmp" ; then
  251.     INFODIR="${tmp}:/usr/local/info:/usr/share/info:/usr/info"
  252.     else
  253.     INFODIR="/usr/local/info:/usr/share/info:/usr/info"
  254.     fi
  255.     INFOPATH=$INFODIR
  256.     unset tmp
  257.     export INFODIR INFOPATH
  258. fi
  259.  
  260. #
  261. # These settings are recommended for old motif applications
  262. #
  263. if test -z "$PROFILEREAD" ; then
  264.     if [ -r /usr/share/X11/XKeysymDB ]; then
  265.     export XKEYSYMDB=/usr/share/X11/XKeysymDB
  266.     else
  267.     export XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
  268.     fi
  269.     if [ -d /usr/share/X11/nls ]; then
  270.     export XNLSPATH=/usr/share/X11/nls
  271.     else
  272.     export XNLSPATH=/usr/X11R6/lib/X11/nls
  273.     fi
  274.  
  275.     #
  276.     # Midnight Commander needs this to run in color mode
  277.     #
  278.     COLORTERM=1
  279.     export COLORTERM
  280. fi
  281.  
  282. #
  283. # For RCS
  284. #
  285. #VERSION_CONTROL=numbered
  286. #export VERSION_CONTROL
  287.  
  288. #
  289. # Source the files generated by SuSEconfig
  290. #
  291. # But do not source this if PROFILEREAD is already set to avoid
  292. # overriding locale variables already present in the environment
  293. #
  294. if test -z "$PROFILEREAD" ; then
  295.     test -r /etc/profile.d/sh.ssh   && . /etc/profile.d/sh.ssh
  296.     test -r /etc/SuSEconfig/profile && . /etc/SuSEconfig/profile
  297.     if test -z "$SSH_SENDS_LOCALE" ; then
  298.         if test -r /etc/sysconfig/language -a -r /etc/profile.d/sh.utf8 ; then
  299.         tmp="$(. /etc/sysconfig/language; echo $AUTO_DETECT_UTF8)"
  300.         test "$tmp" = "yes" && . /etc/profile.d/sh.utf8
  301.         unset tmp
  302.     fi
  303.     fi
  304. fi
  305.  
  306. #
  307. # Source profile extensions for certain packages, the super
  308. # may disable some of them by setting the sticky bit.
  309. #
  310. if test -d /etc/profile.d -a -z "$PROFILEREAD" ; then
  311.     for s in /etc/profile.d/*.sh ; do
  312.     test -r $s -a ! -k $s && . $s
  313.     done
  314.     unset s
  315. fi
  316.  
  317. if test "$is" != "ash" ; then
  318.     #
  319.     # And now let's see if there is a local profile
  320.     # (for options defined by your sysadmin, not SuSE Linux)
  321.     #
  322.     test -s /etc/profile.local && . /etc/profile.local
  323. fi
  324.  
  325. #
  326. # System wide configuration of bourne shells like ash
  327. #
  328. if test "$is" != "ksh" -a "$is" != "zsh" -a -z "$PROFILEREAD" ; then
  329.     ENV=/etc/bash.bashrc
  330.     export ENV
  331. fi
  332.  
  333. #
  334. # Avoid overwriting user settings if called twice
  335. #
  336. if test -z "$PROFILEREAD" ; then
  337.     readonly PROFILEREAD=true
  338.     export PROFILEREAD
  339. fi
  340.  
  341. #
  342. # Standard ssh command does not do an login, therefore
  343. # /etc/profile will be sourced by /etc/bash.bashrc
  344. #
  345. if test -z "$_SOURCED_FOR_SSH" ; then
  346.     #
  347.     # System BASH specials, maybe also good for other shells
  348.     # Note that ksh always reads /etc/ksh.kshrc
  349.     #
  350.     if test "$is" != ksh -a "$is" != zsh ; then
  351.     test -r /etc/bash.bashrc && . /etc/bash.bashrc
  352.     fi
  353.     if test -n "$restricted" ; then
  354.     readonly _HOMEBASHRC=true
  355.     fi
  356.     if test "$is" = "bash" -a -z "$_HOMEBASHRC" ; then
  357.     # loop detection
  358.     readonly _HOMEBASHRC=true
  359.     test -r $HOME/.bashrc && . $HOME/.bashrc
  360.     fi
  361.  
  362.     #
  363.     # KSH specials
  364.     #
  365.     if test "$is" = "ksh" -a -r /etc/ksh.kshrc ; then
  366.     if test -n "$restricted" ; then
  367.         readonly _HOMEKSHRC=true
  368.     fi
  369.     if test ! /etc/bash.bashrc -ef /etc/ksh.kshrc ; then
  370.         test -r /etc/bash.bashrc && . /etc/bash.bashrc
  371.     fi
  372.     if test -n "$ENV" -a "$ENV" != "\$HOME/.kshrc" -a -z "$_HOMEKSHRC" ; then
  373.         # loop detection
  374.         readonly _HOMEKSHRC=true
  375.         test -r $HOME/.kshrc && . $HOME/.kshrc
  376.     fi
  377.     fi
  378. fi
  379. if test -n "$restricted" ; then
  380.     PATH=/usr/lib/restricted/bin
  381.     export PATH
  382. fi
  383.  
  384. #
  385. # An X session
  386. #
  387. case "$-" in
  388. *i*)
  389.     if test "$TERM" = "xterm" -a -O "$tty" ; then
  390.     if test -z "${SSH_TTY}" ; then
  391.         test ! -f $HOME/.hushlogin -a -s /etc/motd && cat /etc/motd
  392.         echo "Directory: $PWD"
  393.         # Last but not least
  394.         date
  395.     fi
  396.     #
  397.     # shadow passwd
  398.     # Note: on normal console this will be done by /bin/login
  399.     if test -r /var/log/faillog ; then
  400.         test -x /bin/faillog && /bin/faillog
  401.         test -x /usr/bin/faillog && /usr/bin/faillog
  402.     fi
  403.     fi
  404. esac
  405.  
  406. #
  407. # End of /etc/profile
  408. #
  409.