user global environment for (t)csh from /etc?

user global environment for (t)csh from /etc?

Post by Eric D. Hendrickson (C » Tue, 14 May 1996 04:00:00



I'm gradully migrating a slew of SunOS 4.x machines to Solaris 2.x here.
The system for user shell environment as implemented by my predecessors is
to have a a one-line ~/.{cshrc,login} for each user that says ``source
/usr/share/defaults/{cshrc,login}''.

I'm thinking that with the move to Solaris it might be opportune to take
advantage of the fact that tcsh automagically sources /etc/.cshrc and
/etc/.login to provide a default environment (path, etc).  However, many
users are csh users and the *y csh only sources the user's own dot
files, except /etc/.login, and then only if ~/.login does not exist.  This
is a serious problem for those who do have ~/.login files, as even with a
line in /etc/.login to source /etc/.cshrc, you won't see any of it.  This
is also true if you start up a non-login csh session (such as under CDE).

I don't want to force csh users to switch to tcsh, even though they might
like it better in the long run...

Anybody have any suggestions as to how to cleanly implement a default shell
environment for users?  To me, user dot files are customizations, I would
think a user should not HAVE to have *any* dot files in order to have a
workable environment.  But maybe I'm just making a mountain out of a
molehill.  Even so, I am curious as to how other people have solved this
``problem''.

Regards,
                Eric
--
                            Knicks Asst. Coach Ralph Willard on how to stop
                            Michael Jordon:
                               "I am just going to tell them to get some
                                kryptonite."

Eric D. Hendrickson              Computational Biology Centers/Medical School
Senior Analyst/Programmer           University of Minnesota, Twin Cities, USA
612/625-3644 (phone)           <a href="http://www.veryComputer.com/~edh">Crystal Cave</a>
612/626-0623 (fax)        Damnit!  I can't stop the heterocyclic declination!

 
 
 

user global environment for (t)csh from /etc?

Post by Gnu A » Wed, 15 May 1996 04:00:00



: I don't want to force csh users to switch to tcsh, even though they might
: like it better in the long run...

: Anybody have any suggestions as to how to cleanly implement a default shell
: environment for users?  To me, user dot files are customizations, I would
: think a user should not HAVE to have *any* dot files in order to have a
: workable environment.  But maybe I'm just making a mountain out of a
: molehill.  Even so, I am curious as to how other people have solved this
: ``problem''.

I believe adding these lines to the begining of each user's .cshrc
file will do what you want:

# Run (source) the global shell startup if it has not yet been run
if (!($?gcshrc)) source /etc/csh.cshrc; unset gcshrc
# Individual user additions should be placed beyond this point.

the /etc/csh.cshrc file is the defaults file.  Here is the csh.cshrc file
on my system:

setenv MAIL /usr/spool/mail/$USER

set gcshrc=1
if ($?prompt) then
        set prompt = "% "
        set notify
        set history = 20
        limit coredumpsize 0
        alias pd pushd
        alias pop popd
        alias lo logout
        alias dir "ls -l"
        alias setpass passwd
        alias del "rm -i"
        alias vt52 "set term = vt52"
        alias vt100 "set term = vt100"
endif

Hope this helps...


------------------------------------------------------------------------------
And all the sterile striking it defends an empty dock you cast away
And rain up on your forehead where the mist's for hire if it's just too clear.
        Let's spend our last 1/4 stance randomly
        Go down to the outlet once again.
                                                "Here" - Pavement
------------------------------------------------------------------------------

PGP Public Key Fingerprint: DC B0 89 F3 72 1B FC 22  BD EF 93 75 42 F3 72 F6

 
 
 

user global environment for (t)csh from /etc?

Post by Phillip M » Tue, 21 May 1996 04:00:00




>Anybody have any suggestions as to how to cleanly implement a default shell
>environment for users?  To me, user dot files are customizations, I would
>think a user should not HAVE to have *any* dot files in order to have a
>workable environment.  But maybe I'm just making a mountain out of a
>molehill.  Even so, I am curious as to how other people have solved this
>``problem''.

Maybe I don't understand the post properly. But you can specify what
shell with Admintool, and have a set of pre-defined "." files
available for installation into the users home directory with it as
well, ie /etc/skel ? No?
 
 
 

user global environment for (t)csh from /etc?

Post by kr » Tue, 21 May 1996 04:00:00



: >Anybody have any suggestions as to how to cleanly implement a default shell
: >environment for users?  To me, user dot files are customizations, I would
: >think a user should not HAVE to have *any* dot files in order to have a
: >workable environment.  But maybe I'm just making a mountain out of a
: >molehill.  Even so, I am curious as to how other people have solved this
: >``problem''.
: Maybe I don't understand the post properly. But you can specify what
: shell with Admintool, and have a set of pre-defined "." files
: available for installation into the users home directory with it as
: well, ie /etc/skel ? No?

Well, those dot files still don't effect existing users... I know in tcsh
you can modify your /etc/csh.cshrc file.  This file, theoretically, is
supposed to be a global scope for csh users.. but on my old SunOS system,
it is not.  I think the location, /etc/csh.cshrc is independant of platform
when you are using tcsh.

For my csh, I have made little "modules" with things like, autodetect DISPLAY,
and prompt settings... I put them in /share, and let users source them into
their .cshrc files... It is convenient for dealing with users who were hear
before me because I don't have to mess with their individual dot files.

Ken.

--
/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\
\   The Whittaker's domain!                                                /
/   Try our MUD (Multi User Domain)                                        \
\   Come to:                                                               /
/   aGe oF iNsaNitY                                                        \
\   telnet to: newton.whit.org 4000                                        /
/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\--/--\

 
 
 

1. Setting global ENV var for all users in /etc/init.d/*-scripts ?

Hi !

----

Is there "standard" way how to export a global shell var from a
/etc/init.d/*-script (e.g. Solaris environment) to all further user
logins ?
The information is only available within the /etc/init.d/* script - but
must be available to the users...

... any ideas ?

----

Bye,
Roland

--
  __ .  . __


  /O /==\ O\  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
 (;O/ \/ \O;) TEL +49 641 99-41370 FAX +49 641 99-41359

2. OFS/UI info needed.

3. getting xdm to read /etc/profile and /etc/environment

4. CORE SHELL

5. ssh chrooted enviroment WITHOUT /bin /etc /lib - etc etc in the users dir ?

6. FTP Server, chroot

7. global environment variables before 1st login

8. unprofessional software writers can't write secure code -- FrankenTROLL

9. defining global environment variable

10. Quest: how to set global environment variables?

11. NCSA httpd: forcing global environment variables

12. Quest: how to set global environment variables?

13. Global Environment Variables