Subject: Re: CVS commit: basesrc/bin/ksh
To: Joerg Klemenz <joerg@gmx.net>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-userlevel
Date: 10/03/2002 15:37:24
>If you login w/ ksh and run "csh" it executes /etc/csh.cshrc and ~/.cshrc.
>That makes it very easy for the user: No need for workarounds and tons
>of "if [..", just put everything in .cshrc

>Makes a lot of sense to me

Sorry, but it is a bad idea.  People who put "everything in .cshrc" cause
nightmares for people like me trying to build systems that need to control
the environment.  Eg. provide a system that is supposed to craft a certain
environment - PATH etc so that correct versions of tools, libs etc are used
and then let the user run $SHELL - and bang, .cshrc screws all the setup.

Sure its a bug in the .cshrc file - but sadly the vast majority of csh users
seem to do things that way.  PATHs and such should be set from .login (.profile or whatever).  Scripts that may need to be run via ssh (rsh if you insist)
should take care to set the PATH's they need.


>With csh or zsh it's trivial: Just use /etc/csh.cshrc or /etc/zshenv

>With sh or ksh it's impossible, right? I'm willing to learn.

Its trivial.

. /etc/cron-env

or whatever you want.

--sjg