This is somewhat off-topic, but I couldn't think of a better place to
ask the question...
I've been trying to get some command-line software working under
10.4 (latest version). Most of it runs happily in terminal/bash.
One of the modules, however, has to be run in an x11 window.
Experimentation showed that the terminal/bash programs required
the paths to be set in /etc/profile and/or ~/.profile - /etc/bashrc
and ~/.bashrc seemed to be ignored (is that what's supposed to\happen?)
However, it appears that sessions opened in an x11 window (Apple's
version, installed from the developer tools pacakge) ignores
/etc/profile and ~/.profile (again, is that normal?)
The application in question is gromacs, who's modules run happily
under terminal in a bash shell except for ngmx which requires
the x11 window. cd'ing to the appropriate directory and directly
invoking the program (./ngmx) within the x11 window works.
Can I get x11 sessions to use /etc/profile and ~/.profile, or do
I need to duplicate the path settings somewhere else? If so,
where? Is there a good tutorial somewhere that explains (for
the non-*nix adept) how all these things (terminal, aquaterm, x11,
bash, etc.) work and how to configure them correctly?
Most of the hints I've found so far have referred to earlier
incarnations of X where the default shell was tcsh, and things
don't work quite the same way...
Dave Seaman - 25 Apr 2006 21:04 GMT
> Can I get x11 sessions to use /etc/profile and ~/.profile, or do
> I need to duplicate the path settings somewhere else? If so,
> where? Is there a good tutorial somewhere that explains (for
> the non-*nix adept) how all these things (terminal, aquaterm, x11,
> bash, etc.) work and how to configure them correctly?
Whether you use Terminal or xterm, you are running a shell. The
difference is that Terminal runs a login shell by default, while xterm
does not. Login shells are the only ones that process /etc/profile and
~/.profile or ~/.bash_profile. If your login shell happens to be csh or
tcsh, then it processes /etc/csh.login and ~/.login instead.
You can make xterm start up a login shell by invoking it with the "-ls"
flag, as described in "man xterm". Another way is to define a resource
in your ~/.Xresources file:
XTerm*LoginShell: true

Signature
Dave Seaman
U.S. Court of Appeals to review three issues
concerning case of Mumia Abu-Jamal.
<http://www.mumia2000.org/>
David Stone - 26 Apr 2006 12:31 GMT
> > Can I get x11 sessions to use /etc/profile and ~/.profile, or do
> > I need to duplicate the path settings somewhere else? If so,
[quoted text clipped - 13 lines]
>
> XTerm*LoginShell: true
I only see ~/.Xauthority - are there any other possible locations,
or do I have to create one? As I said in my original post, I
simply ran Apple's package installer and let it use the default
locations - perhaps that was a mistake?
Dave Seaman - 26 Apr 2006 20:41 GMT
>> > Can I get x11 sessions to use /etc/profile and ~/.profile, or do
>> > I need to duplicate the path settings somewhere else? If so,
[quoted text clipped - 13 lines]
>>
>> XTerm*LoginShell: true
> I only see ~/.Xauthority - are there any other possible locations,
> or do I have to create one? As I said in my original post, I
> simply ran Apple's package installer and let it use the default
> locations - perhaps that was a mistake?
You can create your own ~/.Xresources. Notice that the file
/etc/X11/xinit/xinitrc looks for this file and uses it if it exists.
Type "man xterm" and scroll down to the section on RESOURCES to see what
can go into your .Xresources file. Similarly for other X11 apps.

Signature
Dave Seaman
U.S. Court of Appeals to review three issues
concerning case of Mumia Abu-Jamal.
<http://www.mumia2000.org/>
David Stone - 26 Apr 2006 21:31 GMT
> >> > Can I get x11 sessions to use /etc/profile and ~/.profile, or do
> >> > I need to duplicate the path settings somewhere else? If so,
[quoted text clipped - 23 lines]
> Type "man xterm" and scroll down to the section on RESOURCES to see what
> can go into your .Xresources file. Similarly for other X11 apps.
Didn't try this, because I tried Ben Artin's solution first and found
it to work very nicely. Archived locally for future reference, however!
Thanks to Ben and Dave for the helpful responses...
Ben Artin - 25 Apr 2006 21:36 GMT
[some stuff about bash's confusing config file behavior]
Put this in your ~/.bash_profile:
. $HOME/.bashrc
and then put all your changes in your .bashrc. That will cover both cases.
hth
Ben

Signature
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>
I changed my name: <http://periodic-kingdom.org/People/NameChange.php>
David Stone - 26 Apr 2006 12:26 GMT
> [some stuff about bash's confusing config file behavior]
That's a masterly understatement!
> Put this in your ~/.bash_profile:
>
> . $HOME/.bashrc
>
> and then put all your changes in your .bashrc. That will cover both cases.
Ok, there isn't a ~/.bash_profile currently, only a ~/.bash_history
- will it work to simply create one?
There is a /etc/bashrc - can I modify this to force the system to
look for $HOME/.bashrc for all users?
Ben Artin - 26 Apr 2006 20:23 GMT
> > [some stuff about bash's confusing config file behavior]
>
[quoted text clipped - 8 lines]
> Ok, there isn't a ~/.bash_profile currently, only a ~/.bash_history
> - will it work to simply create one?
Yes.
> There is a /etc/bashrc - can I modify this to force the system to
> look for $HOME/.bashrc for all users?
Yes, but note that /etc/bashrc is owned by the OS and will be reverted to its
pristine state by OS installs.
Ben

Signature
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>
I changed my name: <http://periodic-kingdom.org/People/NameChange.php>