I haven't had the chance to play around with PATH setting on RH 5.0
yet, but some things I've learned from other systems may play here.
>>>>> "Greg" == Greg Fall <[EMAIL PROTECTED]> writes:
> There are a million ways you could reconcile these situations
> (change various things in /etc/profile, ~/.bash_profile, or
> ~/.bashrc, set up your window manager to pass an option to all
> xterms that makes them start login shells, blah blah blah), but I
> prefer the following:
> Set the xdm resources like this in /etc/X11/xdm/xdm-config:
> DisplayManager._0.userPath: \
> /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin/:\
> /usr/bin/mh:
> DisplayManager._0.systemPath: \
> /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:\
> /usr/X11R6/bin:/usr/bin/mh:
What's the difference between setting this in xdm-config and setting
it in Xresources?
> In /etc/skel/.bash_profile, take PATH=$PATH:$HOME/bin out (along
> with the PATH part of the export that follows), and put it in
> /etc/skel/.bashrc, like this:
> export PATH=$PATH:$HOME/bin
Isn't .bashrc run by every non-login bash? Therefore, doesn't this
imply that every subshell will have its PATH variable updated such
that after these commands:
$ bash
$ bash
$ bash
the PATH will be $PATH:$HOME/bin:$HOME/bin:$HOME/bin ??
I know a lot of people set environment variables in the bashrc file
(or cshrc file for CShell users). IMHO, this is bad practice as it
can lead to unexpected happenings when you (for testing purposes) set
an environment variable (by hand or special command), only to have the
bashrc file set it back to your default in a subshell (or made very
long thru addition as in the above).
One question I have is how is the 'rsh' command handled? Does 'rsh'
start up a bash shell? If so, is ~/.bashrc run? In the case of
CShell, remote shells is the typical reason for setting environment
variables in the ~/.cshrc file -- so that 'rsh' (or 'remsh' from HPUX)
invoked remote shells get the "right" environment. I've always felt
that this is a bug in rsh -- there should be a way of identifying a
remotely started shell (perhaps thru an environment variable). There
are tricks to handling this in better ways.
BTW, who handles the MAN pages for rlogin and rsh? Right now, I can't
get rsh to work for me ("Permission denied"). Isn't creating a
.rhosts file enough? This could be described better in the MAN pages.
> instead (.bashrc is sourced by .bash_profile). Write a little
> script called "/usr/local/bin/redot" that looks like this:
> #!/bin/sh
> cp -f /etc/skel/.* $HOME/
Its better to be kind to your users -- use '-i' instead of '-f'.
> and tell all your users to run it if their paths are annoying them.
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject.