Ask a Question related to Ubuntu, Design and Development.
-
Al Krieger #1
Re: .bash_profile
On Fri, 03 Mar 2006 16:36:30 +0000, Richard G. Riley wrote:
As a result of the (justifiably) buried traditions of unix dating back to> My login shell is the gnome default of bash.
>
> According to:
>
> [url]http://www.troubleshooters.com/linux/prepostpath.htm#_singleuser_[/url]
>
> my .bash_profile should be executed at login.
>
> At the end of my bash profile I have:
>
> # set PATH so it includes user's private bin if it exists if [ -d ~/bin
> ] ; then
> PATH=~/bin:"${PATH}"
> fi
>
> This is an installed default.
>
> In my home directory I have a bin directory:
>
> drwxr-xr-x 2 user group 4096 2006-03-03 17:29 bin
>
> and in that directory I have a bash shell script:
>
> -rwxr-xr-x 1 user group 271 2006-03-03 17:29 psp
>
> But my path doesnt have my bin directory on it even after restarting:
>
> PATH=/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/games
>
>
> I'm sure this is glaringly obvious, but I cant see the solution.
>
> Any help greatfully received!
Bell Labs and UCB being on opposite coasts. There are two startup files
for linux. Your path statement should go in .bashrc (I think). Just to
be safe, I source .bashrc from .bash_profile ! If you ever find a BETTER
as distinct from confusing, rationale for the existence of two startup
files when we no longer need the distinctions that led to their original
use, let me know. The use of the words "login shell" in the explanation
are not permitted. :-)
Al Krieger Guest
-
gdm and /etc/profile, ~/.bash_profile
hello, gdm in the past (maybe 1 or 2 months ago) used /etc/profile when i logged in. now it doesnt seem to. same with my .bash_profile. has... -
Florian Diesch #2
Re: .bash_profile
Richard G. Riley <rgriley@gmail.com> wrote:
When you use gdm to login your bash is not executed as a login shell but> My login shell is the gnome default of bash.
>
> According to:
>
> [url]http://www.troubleshooters.com/linux/prepostpath.htm#_singleuser_[/url]
>
> my .bash_profile should be executed at login.
as a plain interactive shell so it doesn't read ~/.bash_profile but
~/.bashrc.
The name "login shell" is a bit confusing here. A login shell is one
whose first character of argument zero is a -, or one started with the
--login option.
Florian
--
No no no! In maths things are usually named after Euler, or the first
person to discover them after Euler.
[Steven D'Aprano in <pan.2005.11.22.10.29.25.388240@REMOVETHIScyber.co m.au>]
Florian Diesch Guest
-
Moe Trin #3
Re: .bash_profile
On Fri, 03 Mar 2006, in the Usenet newsgroup alt.os.linux.ubuntu, in article
<pan.2006.03.04.01.34.51.228242@my.house>, Al Krieger wrote:
What's wrong with reading the man page for bash?>On Fri, 03 Mar 2006 16:36:30 +0000, Richard G. Riley wrote:
>>> My login shell is the gnome default of bash.
>>
>> According to:
>>
>> [url]http://www.troubleshooters.com/linux/prepostpath.htm#_singleuser_[/url]
>>
>> my .bash_profile should be executed at login.
An answer to your question may be that you are using a graphical login
rather than the old fashioned way (/bin/login), and it is starting a
graphical display manage rather than a _login_ shell. You need to read
the man page for your display manager to see how to get your environmental
variables set. This _MIGHT_BE_ done in .xsession in your home directory.
Oh, really? That would be one hell of a piece of news to Stephen Bourne.>As a result of the (justifiably) buried traditions of unix dating back to
>Bell Labs and UCB being on opposite coasts. There are two startup files
>for linux.
No. See the man page for your shell. ".bashrc" is run every time any>Your path statement should go in .bashrc (I think).
bash shell is started, as opposed to /etc/profile, followed by .bash_profile
(if it exists, else .bash_login if it exists, else .profile if it exists)
in the user's home directory when then user logs in. What's the difference?
Simple. Putting the PATH=extension:$PATH argument in the .bashrc gets a
runaway expansion each time a new shell is spawned.
[compton ~]$ w | grep -c bash
15
[compton ~]$
So instead of seeing
[compton ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/ibuprofin/bin
[compton ~]$
(I expand from the tail, rather than the start of the PATH), I'd see
[compton ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/ibuprofin/bin
:/home/ibuprofin/bin:/home/ibuprofin/bin:/home/ibuprofin/bin
:/home/ibuprofin/bin:/home/ibuprofin/bin:/home/ibuprofin/bin
:/home/ibuprofin/bin:/home/ibuprofin/bin:/home/ibuprofin/bin
:/home/ibuprofin/bin:/home/ibuprofin/bin:/home/ibuprofin/bin
:/home/ibuprofin/bin:/home/ibuprofin/bin:/home/ibuprofin/bin
[compton ~]$
(all on one line) which really isn't what is wanted.
See the man page.>Just to be safe, I source .bashrc from .bash_profile !
I don't run my systems single user. Nor do I run a desktop with one and>If you ever find a BETTER as distinct from confusing, rationale for the
>existence of two startup files when we no longer need the distinctions
>that led to their original use, let me know.
only one terminal, application, or tool. See if you can find the man
page (on google, naturally) for the Bourne shell (/bin/sh). The Korn
shell (/bin/ksh) is somewhat later, but uses the same concept. The BASH
shell (/bin/bash) is even later still, and all are backwards compatible
to the original Bourne shell. The Berkeley 'C' shell (/bin/csh) and it's
derivative the Tenex C shell (/bin/tcsh) also use two startup files
(~/.cshrc and ~/.login) as detailed in _their_ man pages.
The problem is the blurring of WTF is happening on your system. Find a>The use of the words "login shell" in the explanation are not permitted. :-)
command line, and type the command
ps afuwx
and see what the "first" process is with your username.
Old guy
Moe Trin Guest
-
Al Krieger #4
Re: .bash_profile
On Sun, 05 Mar 2006 02:16:33 +0000, Richard G. Riley wrote:
<SNIP>> "Moe"posted the following on 2006-03-04:
>>> On Fri, 03 Mar 2006, in the Usenet newsgroup alt.os.linux.ubuntu, in article
>><pan.2006.03.04.01.34.51.228242@my.house>, Al Krieger wrote:
>>>>>On Fri, 03 Mar 2006 16:36:30 +0000, Richard G. Riley wrote:
>>>
>>>> My login shell is the gnome default of bash.
>>>>
>>>> According to:
>>>>
>>>> [url]http://www.troubleshooters.com/linux/prepostpath.htm#_singleuser_[/url]
>>>>
>>>> my .bash_profile should be executed at login.In case you're wondering Stephen Bourne was the guy at AT&T Bell Labs who>>Oh really? That would be one hell of a piece of news to Stephen Bourne.
wrote the original unix shell
<SNIPimpenetrable.>You are not helping. You seem to enjoy making a simple question seemHe's just reacting to my middle of the night sarcasm. Sorry he had to>
take it out on you.Actually I wouldn't be surprised to find I'm older than he is. I didn't>>>>>>The use of the words "login shell" in the explanation are not
>>>permitted. :-)
>> The problem is the blurring of WTF is happening on your system. Find a
>> command line, and type the command
>>
>> ps afuwx
>>
>> and see what the "first" process is with your username.
>>
>> Old guy
learn unix in school because it WASN'T WRITTEN until after I'd gotten my
PhD. Since AT&T was charging an arm and a leg for unix to non academics,
I didn't get a chance to use unix until the late 80's or early 90's and
then it was BSD, which (as pointed out by Moe) uses a whole different
system.The REAL answer is in the post by Florian Diesch.>
> And why didnt I or Al think of that? So obvious.
>
> Thanks for obfuscating it even more.
Al Krieger Guest
-
Al Krieger #5
Re: .bash_profile
On Sun, 05 Mar 2006 15:30:31 +0100, Richard G. Riley wrote:
I agree that it's confusing :-) All I can say for sure is that putting it> "Al"posted the following on 2006-03-05:
>>>> On Sun, 05 Mar 2006 02:16:33 +0000, Richard G. Riley wrote:
>>>>>>> "Moe"posted the following on 2006-03-04:
>>>
>>>> On Fri, 03 Mar 2006, in the Usenet newsgroup alt.os.linux.ubuntu, in article
>>>><pan.2006.03.04.01.34.51.228242@my.house>, Al Krieger wrote:
>>>>
>>>>>On Fri, 03 Mar 2006 16:36:30 +0000, Richard G. Riley wrote:
>>>>>
>>>>>> My login shell is the gnome default of bash.
>>>>>>
>>>>>> According to:
>>>>>>
>>>>>> [url]http://www.troubleshooters.com/linux/prepostpath.htm#_singleuser_[/url]
>>>>>>
>>>>>> my .bash_profile should be executed at login.
>><SNIP>>> In case you're wondering Stephen Bourne was the guy at AT&T Bell Labs who>>>>Oh really? That would be one hell of a piece of news to Stephen Bourne.
>> wrote the original unix shell
> Knew that bit : although in my uni days it was all c-chell.
>>>><SNIP>> impenetrable.>>>You are not helping. You seem to enjoy making a simple question seem>> He's just reacting to my middle of the night sarcasm. Sorry he had to>>>
>> take it out on you.
> Believe me, it didnt bother me a bit. This is usenet. Its Linux
> usenet. There are some pretty aggressive people that take anything
> about Linux as a slight. Its quite scary.
>>>> Actually I wouldn't be surprised to find I'm older than he is. I didn't>>>
>>>>>The use of the words "login shell" in the explanation are not
>>>>>permitted. :-)
>>>>
>>>> The problem is the blurring of WTF is happening on your system. Find a
>>>> command line, and type the command
>>>>
>>>> ps afuwx
>>>>
>>>> and see what the "first" process is with your username.
>>>>
>>>> Old guy
>> learn unix in school because it WASN'T WRITTEN until after I'd gotten my
>> PhD. Since AT&T was charging an arm and a leg for unix to non academics,
>> I didn't get a chance to use unix until the late 80's or early 90's>>>and
> Same as.
>>>> then it was BSD, which (as pointed out by Moe) uses a whole different
>> system.>> The REAL answer is in the post by Florian Diesch.>>>
>>> And why didnt I or Al think of that? So obvious.
>>>
>>> Thanks for obfuscating it even more.
>>
> I saw it : thanks. But still confusing because there are many sources
> out there that state that bash_profile is indeed executed too.
..bashrc seems to work. Florian's explanation sounds plausible, but I
don't have the time or patience to read the source code of GDM to verify
it.
Al Krieger Guest
-
Moe Trin #6
Re: .bash_profile
On 5 Mar 2006, in the Usenet newsgroup alt.os.linux.ubuntu, in article
<46v001Fcod4fU7@individual.net>, Richard G. Riley wrote:
> "Moe"posted the following on 2006-03-04:You didn't specify - but it was the most probable reason.>>> An answer to your question may be that you are using a graphical login
>> rather than the old fashioned way (/bin/login), and it is starting a
>Hmm Hmm. I "maybe". Thanks.
It's not obvious, but when you follow how things forked - the ps afuwx>>> graphical display manage rather than a _login_ shell. You need to read
>> the man page for your display manager to see how to get your environmental
>> variables set. This _MIGHT_BE_ done in .xsession in your home
>> directory.
>I never even considered that. I never thought that my choice of
>"graphical shell" would alter the way a text shell would work.
below is becomes more understandable. You change your PATH, but you
only want to do that once, not repeatedly. The "login" shell is only
run once, while a non-login shell may be run many times.
goggle didn't - it's the people whose articles you read.>Google gave me the wrong info :(
As noted - that wasn't directed at you - it was directed at the>You are not helping. You seem to enjoy making a simple question seem
>impenetrable.
mis-information that Al presented.
In your post of Sun, 5 Mar 2006 15:30:31 +0100, you write:
The man page sorta explains this in the 'INVOCATION' section, but a lot>But still confusing because there are many sources
>out there that state that bash_profile is indeed executed too.
of people make the assumption that a login shell is always going to be
the first thing started. In a text based login, this is still true, but
with a graphic login it's not the case. Look at /etc/inittab, and the
mingetty's are still being started, but you aren't logging in to them.
You are bypassing them with the display manager. This makes your desktop
as the login shell, not bash. Therein lies the problem, because the
man pages don't explain this very well.
Old guy
Moe Trin Guest
-
Moe Trin #7
Re: .bash_profile
On Sat, 04 Mar 2006, in the Usenet newsgroup alt.os.linux.ubuntu, in article
<pan.2006.03.05.04.51.29.1564@my.house>, Al Krieger wrote:
I'm 66. You?>Actually I wouldn't be surprised to find I'm older than he is.>>> Old guy
However, the shells start the same way whether in a Bell/AT&T or BSD>I didn't learn unix in school because it WASN'T WRITTEN until after I'd
>gotten my PhD. Since AT&T was charging an arm and a leg for unix to non
>academics, I didn't get a chance to use unix until the late 80's or early
>90's and then it was BSD, which (as pointed out by Moe) uses a whole
>different system.
style of *nix. I didn't learn that in school either. And yes, I also
started in *nix using BSD, but that was because I was on the left-coast,
25 miles from Berkeley. Maybe it would help if you stopped making guesses
and actually read the man pages. Or don't you have time for that either?
Old guy
Moe Trin Guest



Reply With Quote

