From: tmcconne@sedona.intel.com (Tom McConnell)
Subject: SUMMARY: POLL: What is in X/shell files? (REPOST)
Originator: tmcconne@sedona
Keywords: SUMMARY POLL
Reply-To: tmcconne@sedona.intel.com
Organization: Intel Corporation
Date: Sun, 23 Aug 1992 00:24:33 GMT


  [This is a repost. The first attempt, several days ago, seems to have lost.]

The short version:

  1. Put the environment information in .cshrc.
  2. Put the shell variables and aliases in .cshrc.
  3. Put terminal setup and console setup in .login.
  4. Put terminal setup in X resources (ie., .Xdefaults) for xdm.

The long version:

  These are the results of the poll of the use of environment files. The
original questions are these:

     1. What do you use (what is in) .login for?
 
     2. What do you use (what is in) .cshrc for?
 
     3. What do you use (what is in) .xinitrc for?
 
     4. What do you use (what is in) .xsession for?
 
     5. Do you normally source a separate file for environment variables or
       aliases?

  I appreciate the people who participated in this, and I would like to
thank you for your time.

  Results
  -------

  The results were, at best, mixed. My original reason for conducting the
poll in the first place was to determine, in a multi-architecture,
multi-environment X world, where to put things like path and stty.

  There is not agreement, for instance, on where to put environment
variables.  Twelve (12) of the responses used .cshrc, and fourteen (14)
used .login. Nearly everyone used .login for stty (terminal setup), and
nearly everyone used .cshrc for "set" and "alias."

  The disagreement on where to set path seems to be a result of xdm and
rsh, neither of which automatically invokes .login. In order to ensure
that a path is available, the path was often set in .cshrc. For the
.xsession file under xdm, a common response was to source .login, or just
to duplicate the information from .login in the .xsession file.

  From these responses, I would say that the "best" approach is to use
what works (brilliant, isn't it :). Here are some general guidelines
that seem to be in common use:

    1. Most people tend to have a small set of files, with one or two
      additional files that are sourced for environment or alias information.

    2. If rsh is going to be used, the general solution seems to be to
      put the environment information in .cshrc.

    3. If xdm is going to be used, either put all of the environment
      information in .xsession, source a "environment variables" file, or
      put environment information in .cshrc.

  From numbers 2 and 3, it seems the most prudent approach is to put
the environment information in .cshrc. .cshrc also has the shell
variables and the aliases. This leaves terminal setup and
console-specific setup for .login. When using xdm, terminal information
can be set up in the X resources (thanks to Bruno Berstel for this
example):

        * The .Xresources files

	...
	# We know it's Delete because of the xmodmap in .x{initrc,session}
	XTerm*ttyModes:         erase ^? kill ^U intr ^C
	...
	# You should try that : when you select a chunk of text in a window
	# with the shift key down, it's automagically pasted on the command
	# line without any other button press.
	XTerm*VT100.translations: \
		Meta<KeyPress>  : string(0x1b) insert() \n\
		<KeyPress>      : insert()
	...

  Again, thank you for your time. If anyone would like a copy of the
responses, I would be glad to send them to you. I would prefer to send a
uuencoded, compressed tar file of the responses, but any form is fine
with me. Please send a request via email to:

       tmcconne@sedona.intel.com

    Cheers,

    Tom McConnell

 Tom McConnell          |     Internet: tmcconne@sedona.intel.com
 Intel, Corp. C3-21     |     Phone: (602)-554-8229
 5000 W. Chandler Blvd. | The opinions expressed are my own. No one in 
 Chandler, AZ  85226    | their right mind would claim them.


  Comments
  --------

  I only tally the responses that are explicit. For instance, if a response
says:

      Everything is in .login

I only count a response as "everything." I do _not_ add to the number of
.login responses.

  Most of the responses had some commentary about why certain things
were "good" or "bad." For instance, Bruno Berstel provided a very
nice background for environment issues in general.

  A number of the responses noted that they do not use C shell, but
some other shell. zsh and the Bourne shell were common. As a result,
the number of responses for .login and .cshrc are somewhat subjective,
based on comments in the response.

  Several responses indicated that they used global, site, or the
default file. Global alias files and /usr/lib/X11/xdm/Xsession are
examples. I have seen differences in Xsession at different sites, so
I have made no attempt to determine what "should" be in Xsession.

  Results
  -------
Total number of responses: 28

Environment variables in .cshrc: 12
Environment variables in .login: 14

Everything in .cshrc: 4
Everything in .login: 1

Terminal setup (TERM, stty, tset) in .cshrc: 3
Terminal setup (TERM, stty, tset) in .login: 19

4 responses with no .login file.
1 response with no .cshrc file.

Response where .xinitrc is the same as .xsession: 10
         of these> set path in .login: 3
                   set path in .cshrc: 3

.xsession sets up environment directly: 8
.xsession sources a file: 2
.xsession uses "xterm -ls": 1

  Participants
  ------------
Tom McConnell       <tmcconne@sedona.intel.com>
Steven Ball         <steve@cs.anu.edu.au>
Mark Watson         <mark@wehi.edu.au>
Jim Fulton          <lupine!verbosa!jim@uunet.UU.NET>
Ian Fitchet         <I.D.Fitchet@cs.bham.ac.uk>
Andy Stevens        <stevens@madvlsi.columbia.edu>
Thomas Richter      <richter@ki1.chemie.fu-berlin.de>
Paul Davey          <pd@x.co.uk>
Donn Cave           <donn@cac.washington.edu>
Bruno Berstel       <berstel@lacim.uqam.ca>
Ami Kleinman        <ami@shum.huji.ac.il>
Amos Shapira        <amoss@CS.HUJI.AC.IL>
Tom Tatlow          <tatlow@athena.lmo.dec.com>
Mark Anderson       <mark@cs.ucsd.edu>
John G Dobnick      <jgd@uwm.edu>
Matt Wette          <mwette@jpl-gnc-gw.Jpl.Nasa.Gov>
Richard Pieri       <ratinox@meceng.coe.northeastern.edu>
Daniel S. Lewart    <d-lewart@uiuc.edu>
Niclas Wiberg       <nicwi@isy.liu.se>
Nick Smith          <nick@garland.bt.co.uk>
Steve Rumsby        <steve@maths.warwick.ac.uk>
Dan Connolly        <connolly@pixel.convex.com>
Curt Schroeder      <curts@tmpcu.mdc.com>
Andrew Stoker       <mac742@lancaster.ac.uk>
Bill Trost          <trost@reed.edu>
Jon Marthins        <jon@dikas.no>
Daniel MacKay       <daniel@nstn.ns.ca>
M. Eyckmans         <eyckmans@imec.be>

-- 
 Tom McConnell          |     Internet: tmcconne@sedona.intel.com
 Intel, Corp. C3-21     |     Phone: (602)-554-8229
 5000 W. Chandler Blvd. | The opinions expressed are my own. No one in 
 Chandler, AZ  85226    | their right mind would claim them.
Newsgroups: comp.unix.admin,alt.security