Re: PATH problem
Re: PATH problem
On Wed, Mar 19, 2003 at 06:36:45PM -0500, tom wible wrote:
> >>settings (PATH, ecc) in xterm?
> >Such changes probably belong in your .cshrc file, rather than your
> >.login. The former is sourced by all shells when they start, the latter
> >only by login shells. Terminal.app starts login shells, xterm does not
>
> actually, paths(w/recursive defs) should _not_ be in the .cshrc, since
> the path can overflow from repeated invocations...
>
> >(although it can be made to do so by giving it the -ls option)
> >
> >Personally, I find the distinction between login and non-login shells in
> >UNIX almost completely pointless.
>
> and that's the reason...
Good point. As it happens, I don't use csh derivatives as login
shells, but generally use bash on all systems I have access to. Being a
bourne shell does not make it immune from the same problem of course,
but I get around it by having shell functions in my .bashrc which:
(a) Remove a directory from a path if it's already there and
(b) append or prepend directories to path variables, but only if the
directory exists, and only if the directory is not already in the
path.
This means I can use the same .bashrc on multiple architectures (I use
the same file for MacOS X, IRIX, Tru64, AIX, HP-UX, Linux and Solaris)
and my PATH variable (and similar variables such as PERLLIB, MANPATH and
LD_LIBRARY_PATH) never have redundant entries, or entries which don't
actually exist on the system.
Sadly, you can't easily do the same thing in csh or tcsh, because they
don't support shell functions.
Tim
--
Dr Tim Cutts
Informatics Systems Group
Wellcome Trust Sanger Institute, Hinxton, Cambridge, CB10 1SA, UK
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.