>>>>> "John" == J Pelan <J....@Qu...> writes:
John> dpi said;
>> Why sould one put the path-things in .cshrc? I thought, the value of
>> PATH in a further shell is the same as in the login shell?
John> There are a number of situations where shells are not started
John> from a login shell and so they can't inherit the PATH. The most
John> common of these occurs when using remsh (rsh), where a correct path
John> on the remote machine may be essential. There might also be problems
John> in some X11 environments etc.
John> I believe that just about everyone recommends placing vital
John> environment variables in .(t)cshrc. The way I look at it is
John> that .login only performs things that are required once per login
John> (like checking mail, launching processes etc.) but the rc file sets
John> up everything that is required for *every* invocation of that shell
John> (The rc file should not write to STDOUT however).
John> Likewise this is where the module calls should go too.
Guess I don't fit in with "just about everyone", because I don't
recommend this! In fact, I usually recommend NOT setting environmental
variables in the .kshrc/.cshrc/... files. After all, the interesting
thing about an environment variable is that it is inherited by child
processes. Often I have two xterms running two shells with different
environments at the same time; perhaps because I have two different
versions of vendor software going, or because I am working on
different projects that use environment variables to specify data
directories, etc. When I invoke ksh scripts I don't want them to reset
the PATH or other environment variables; I actually *want* different
environments to be inherited down different process trees. Likewise,
this is where module files should NOT go. I load my default modules in
my .(z)profile, then sometimes switch them to other modules in various
invokations of interactive shells.
I haven't had any problems with X; it just gets the environment active
at the time that I start xinit. But maybe some implementations are
different. I would be interested in the problems.
remsh that does not execute a login startup file is a problem, but I
need to solve it a different way because if I have a choice of
environments for software versions or something (or equivalently, a
choice of modules), I need a way to convey that choice to the remote
shell. So one possibility might be to have the remote command be a
script that has some arguments that set the environment/module inside
the script. Another is to write a generalized way to save the current
environment in a file, create the remote process, warp its environment
to match that of the file, and then execute the desired commands. This
is like creating a "virtual child" process on another machine, at
least with respect to the environments.
Anyway, there's my $0.02, which may not be worth much in the UK!
--
Todd Bridges - IBM PowerPC Embedded Processor Design
tbr...@ra... 919/543-4535 (office)
PO Box 12196, Dept. B52, Bldg 060/E125, RTP, NC 27709
jtb...@wo... (fun stuff)
|