打印

profile

profile

####################UNIX /etc/profile#################
     1  umask 007
     2  # @(#)B.11.11_LR
     3
     4  # Default (example of) system-wide profile file (/usr/bin/sh initialization).
     5  # This should be kept to the bare minimum every user needs.
     6
     7  # Ignore HUP, INT, QUIT now.
     8
     9          trap "" 1 2 3
    10
    11  # Set the default paths - Do NOT modify these.
    12  # Modify the variables through /etc/PATH and /etc/MANPATH
    13
    14          PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin
    15          MANPATH=/usr/share/man:/usr/contrib/man:/usr/local/man
    16
    17  # Insure PATH contains either /usr/bin or /sbin (if /usr/bin is not available).
    18
    19          if [ ! -d /usr/sbin ]
    20          then
    21                  PATH=$PATH:/sbin
    22
    23          else    if [ -r /etc/PATH ]
    24                  then
    25
    26                  # Insure that $PATH includes /usr/bin .  If /usr/bin is
    27                  # present in /etc/PATH then $PATH is set to the contents
    28                  # of /etc/PATH.  Otherwise, add the contents of /etc/PATH
    29                  # to the end of the default $PATH definition above.
    30
    31                          grep -q -e "^/usr/bin$" -e "^/usr/bin:" -e ":/usr/bin:"\
    32                                  -e ":/usr/bin$" /etc/PATH
    33                          if [ $? -eq 0 ]
    34                          then
    35                                  PATH=`cat /etc/PATH`
    36                          else
    37                                  PATH=$PATH:`cat /etc/PATH`
    38                          fi
    39                  fi
    40          fi
    41
    42          export PATH
    43
    44  # Set MANPATH to the contents of /etc/MANPATH, if it exists.
    45
    46          if [ -r /etc/MANPATH ]
    47          then
    48                  MANPATH=`cat /etc/MANPATH`
    49          fi
    50
    51          export MANPATH
    52
    53  # Set the TIMEZONE
    54
    55          if [ -r /etc/TIMEZONE ]
    56          then
    57             . /etc/TIMEZONE
    58          else
    59              TZ=MST7MDT               # change this for local time.
    60              export TZ
    61          fi
    62
    63  # Be sure that VUE does not invoke tty commands
    64
    65     if [ ! "$VUE" ]; then
    66
    67     # set term if it's not set
    68
    69          if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup"  \
    70               -o "$TERM" = "network" ]
    71          then
    72                  eval `ttytype -s -a`
    73          fi
    74
    75          export TERM
    76
    77     # set erase to ^H, if ERASE is not set
    78          if [ "$ERASE" = "" ]
    79          then
    80                  ERASE="^H"
    81                  export ERASE
    82          fi
    83          stty erase $ERASE
    84
    85     # Set up shell environment:
    86
    87          trap "echo logout" 0
    88
    89
    90     # This is to meet legal requirements...
    91
    92          cat /etc/copyright
    93
    94     # Message of the day
    95
    96          if [ -r /etc/motd ]
    97          then
    98                  cat /etc/motd
    99          fi
   100
   101     # Notify if there is mail
   102
   103          if [ -f /usr/bin/mail ]
   104          then
   105                  if mail -e
   106                  then    echo "You have mail."
   107                  fi
   108          fi
   109
   110     # Notify if there is news
   111
   112          if [ -f /usr/bin/news ]
   113          then news -n
   114          fi
   115
   116     # Change the backup tape
   117
   118          if [ -r /tmp/changetape ]
   119          then    echo "\007\nYou are the first to log in since backup:"
   120                  echo "Please change the backup tape.\n"
   121                  rm -f /tmp/changetape
   122          fi
   123
   124     fi                                           # if !VUE
   125
   126  # Leave defaults in user environment.
   127
   128     trap 1 2 3
   129
   130
   131
   132  alias ed='/usr/bin/ed.top'
   133                      alias sh='/bin/ksh'
   134                      alias pg='less'
   135                      alias sz='/usr/bin/sz'
   136                      alias rz='/usr/bin/rz'
   137
   138  if [ $SHELL = '/bin/ksh' ] ; then
   139                 . /etc/env.top
   140              fi
   141  PATH=/opt/java1.4/bin:$PATH;export PATH
   142
   143  #limit the users' total conecction
   144
   145  if (( $(who|grep $LOGNAME |grep -v root|grep -v informix|grep -v infoth|grep -v grep|grep -v dba|grep -v it|grep
-v CBD02731|grep -v CBD02805|grep -v CTBSQ|grep -v SFCTEST|wc -l) > 2 ))
   146  then
   147     echo '--------------------------------------------'
   148     echo '你已經建立了兩個連綫.... '
   149     echo '--------------------------------------------'
   150     echo "你的連綫數量已經超出額定值 "
   151     echo '--------------------------------------------'
   152     echo "你想殺死先前的連綫嗎? (y/n):\c "
   153     read an
   154     if [ "$an" = "y" ] || [  "$an" = "Y" ]
   155     then
   156         sh /u/tiptop/profile/kuser/k  $LOGNAME
   157     else
   158        echo "Goodbye !"
   159        exit
   160     fi
   161
   162     exit
   163  fi
   164  export HISTFILE=.sh_history
   165  umask u=rwx,g=rwx,o=
   166  echo "Welcome!"
   167  stty -istrip -parity cs8
   168

TOP

linux /etc/profile

1 # /etc/profile
      2
      3 # System wide environment and startup programs, for login setup
      4 # Functions and aliases go in /etc/bashrc
      5
      6
      7 pathmunge () {
      8         if ! echo $PATH | /bin/egrep -q "(^|$1($|" ; then
      9            if [ "$2" = "after" ] ; then
     10               PATH=$PATH:$1
     11            else
     12               PATH=$1:$PATH
     13            fi
     14         fi
     15 }
     16
     17 # Path manipulation
     18 if [ `id -u` = 0 ]; then
     19         pathmunge /sbin
     20         pathmunge /usr/sbin
     21         pathmunge /usr/local/sbin
     22 fi
     23
     24 pathmunge /usr/X11R6/bin after
     25
     26
     27 # No core files by default
     28 ulimit -S -c 0 > /dev/null 2>&1
     29
     30 USER="`id -un`"
     31 LOGNAME=$USER
     32 MAIL="/var/spool/mail/$USER"
     33
     34 HOSTNAME=`/bin/hostname`
     35 HISTSIZE=1000
     36
     37 if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
     38     INPUTRC=/etc/inputrc
     39 fi
     40
     41 export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
     42
     43 for i in /etc/profile.d/*.sh ; do
     44     if [ -r "$i" ]; then
     45         . $i
     46     fi
     47 done
     48
     49 unset i
     50 unset pathmunge

TOP


感谢一直以来您对我们的支持!
当前时区 GMT+8, 现在时间是 2008-10-12 08:02 京ICP证060528 号

Designed By 17DST