[comp.unix.wizards] SYSTEM WIDE .LOGIN/ /ETC/PROFILE

V2002A%TEMPLEVM.BITNET@wiscvm.wisc.EDU (07/27/87)

Keywords: .login /etc/profile

Randy Davis writes:

>
>   The users login shell and users shell are the same shell.  All you need to
> do is to remember to export the enviroment variable, e.g.:
> ---from a sample /etc/profile:-----------
> /bin/echo "Enter terminal type: \c"
> read TERM
> export TERM
> -----------------------------------------
> simple, huh?
>
> Randy Davis                    UUCP:(ihnp4!)3b2fst!randy

     A few comments:

  1)  export TERM *was* in my shell script that I added to /etc/profile.

  2)  My /etc/profile contains the following two comment lines (from ATT)

      #         Login and -su shells get /etc/profile services.
      #         -rsh is given its environment in its .profile.

      I should have specified these two shells, not 'users' and 'login'.

      Apparently the su shell must do the exporting because...

  3)  The following /etc/profile did not work...

      #Ident <comments by ATT>
      #       """"""""""""""""...

      trap "" 2 3

      export LOGNAME

      . /etc/TIMEZONE

      #        Login and -su shells get ..............
      #        ...............
      case "$0" in
      -su )
              export PATH
              ;;
      -sh )
              export PATH
              #      Allow user to break the Message-of-the-day only.
              .
              .
              .

              if mail -e
              .
              .
              .
              .
              .
              .
              .
      esac
      stty erase ^H
      stty echoe
      <<<   Terminal setting routine here   >>>
      umask 022
      trap 2 3

      However, when I moved the Terminal setting routine into the
      case statement, (both -su and -sh) it worked fine.
      I forget who told me this, but thanks for the tip.

      Do Ultrix,Xenix,etc. behave the same way?



      Andy Wing <V2002A@TEMPLEVM.BITNET>