Re: Starting order for xterm vs. terminal
Re: Starting order for xterm vs. terminal
On Tue, Jul 01, 2003 at 02:01:14PM +0100, Ralph Martin wrote:
> Can someone give a clear explanation of exactly what files are read and
> executed as
> (1) Apple's terminal program opens a new window
> (2) Apple's X11 xterm program opens a new window
> The reason I ask is that for the former, I get a path with /usr/bin
> before /usr/local/bin
> while with the latter it /usr/local/bin comes before /usr/bin.
>
> (As I am unfortunate enough to have 2 incompatible version of a
> particular binary installed, this breaks something else in xterm...)
Several things affect the PATH.
Your user environment in aqua has a PATH, I think, and this is inherited
by all Aqua apps (such as Terminal and X11). This can be modified for
the particular application in one of its .plist files, I believe.
X11 executes /etc/X11/xinit/xinitrc (and your ~/.xinitrc, if you have
one) both of which can modify your PATH.
Both Terminal and xterm then execute your .login and/or .cshrc scripts
according to whether the shell is a login shell or not.
The only safe thing to do, in my opinion, is to make sure in your .cshrc
that the path is the one you want. This can be tedious. Try something
like this, if you want /usr/local/bin first:
set path = ( /usr/local/bin ${path:gs+/usr/local/bin++} )
This has the advantage that it removes spurious extra copies of
/usr/local/bin from your path too. The thing to beware of is that it
will break if you have things in your path like /usr/local/bin/other,
because it will convert that to /other, which you probably don't want.
A slightly safer version would be the following, but it's slower because
it has to use perl:
set path = ( /usr/local/bin `perl -e '$,=" "; print grep { \! m+^/usr/local/bin$+ } split(":", $ENV{PATH})'` )
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.