Re: .bash_profile never read in X
From: [EMAIL PROTECTED] (Carl Fink) One thing that has bugged me ever since I switched to gdm: my .bashrc and .bash_profile files are never read. Isn't one problem that when one starts the X server using startx, applications (e.g., xterm) are not started with the same environment that existed in the shell from which the X server started? That is, if you manually (not in a startup script) modify the PATH environment variable in a shell on a virtual console, start X using startx from that shell, and bring up a shell in an xterm (including automatically), the modification to the PATH variable is no longer in effect. I assume this is a result of running the X server with special privileges and resetting PATH for safety. However, can't the X startup scripts save PATH (and anything else reset) and restore the value before the xinitrc script is run and by the time menus can be used to run things? That would follow Unix's normal inheritance of environment settings in subprocesses. Is there any reason this can't be done? (Note that you don't necessarily want to re-read .bash_profile when you start an xterm. You might want to inherit environmental modifications that overrode the original settings from .bash_profile.) Daniel --- End of forwarded message ---
Re: .bash_profile never read in X
[This message has also been posted.] Okay, people pointed out to me that .bash_profile isn't *supposed* to execute in an xterm unless a special flag is used. Fine. On further investigation, .bashrc *is* executing. And I get this output: /home/carlf$ echo $PATH (/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/carlf/bin) . . . so why won't the xterm execute files in /home/carlf/bin unless I prepend an explicit path to them? I have a script, /home/carlf/bin/newsguy, but typing just newsguy get me command not found, although ~carlf/bin/newsguy works fine. -- Carl Fink [EMAIL PROTECTED] This fool wishes to reverse the entire science of astronomy. -Martin Luther on Copernicus' theory that the Earth orbits the sun
Re: .bash_profile never read in X
%% [EMAIL PROTECTED] (Carl Fink) writes: cf On further investigation, .bashrc *is* executing. And I get this cf output: cf /home/carlf$ echo $PATH cf (/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/carlf/bin) cf . . . so why won't the xterm execute files in /home/carlf/bin unless cf I prepend an explicit path to them? If that's really the exact output you get, the answer is obvious; you don't have ``/home/carlf/bin'' on your PATH. You do, however, have ``/home/carlf/bin)'' on your path, a directory which, I assume, doesn't exist. Hint: this is Bourne shell, not C shell; you never put parentheses around variable values. :) -- --- Paul D. Smith [EMAIL PROTECTED] Network Management Development Please remain calm...I may be mad, but I am a professional. --Mad Scientist --- These are my opinions---Nortel Networks takes no responsibility for them.
Re: .bash_profile never read in X
Paul D. Smith wrote: If that's really the exact output you get, the answer is obvious; you don't have ``/home/carlf/bin'' on your PATH. You do, however, have ``/home/carlf/bin)'' on your path, a directory which, I assume, doesn't exist. Hint: this is Bourne shell, not C shell; you never put parentheses around variable values. Ouch. I copied the syntax from some example file years ago and never thought about it until you pointed that out. Thanks. -- Carl Fink [EMAIL PROTECTED]
RE: .bash_profile never read in X
On 29-Jun-99 Carl Fink wrote: [This message has also been posted.] I have a system that was installed from a Debian 2.0 CD-ROM, with many packages upgraded to 2.1 or unstable via the web site. One thing that has bugged me ever since I switched to gdm: my .bashrc and .bash_profile files are never read. Now, I realize that I'm actually using xterm, but I always assumed xterm was some sort of graphical shell for bash, especially since xterms show up in top or ps as bash. bashrc should be read at all times. bash_profile is only read if the xterm (or whatever) is called as a login shell, i.e. xterm -ls.
Re: .bash_profile never read in X
Actually, ~/.bashrc is used only for interactive, non-login shells. If the xterm is invoked with the -ls option, it won't be used (unless it's explicitly sourced within ~/.bash_profile, of course). On Mon, Jun 28, 1999 at 08:16:18PM -0700, Sean 'Shaleh' Perry wrote: On 29-Jun-99 Carl Fink wrote: [This message has also been posted.] I have a system that was installed from a Debian 2.0 CD-ROM, with many packages upgraded to 2.1 or unstable via the web site. One thing that has bugged me ever since I switched to gdm: my .bashrc and .bash_profile files are never read. Now, I realize that I'm actually using xterm, but I always assumed xterm was some sort of graphical shell for bash, especially since xterms show up in top or ps as bash. bashrc should be read at all times. bash_profile is only read if the xterm (or whatever) is called as a login shell, i.e. xterm -ls.