newbie: setting PATH in .profile

newbie: setting PATH in .profile

Post by Gregory C. Lewi » Sun, 11 Jul 1999 04:00:00



This should be an easy one, but I'm new to this, and apparently not as
bright as I once was. Anyway, I'm running COL2.2 and the "bash" shell. I
want to add a reference to my $HOME and working directory to my PATH, so,
like the book says, I added the following to my .profile file in my home
directory:

PATH=$PATH:$HOME:
export PATH

But it doesn't work! What gives? I know it's calling the lines, because I
added an echo "Hello!" line right after the export, and when I enter
.profile, it says Hello! (I have no idea how to see if this executes
during login, but it works from the command line).

Any thoughts?

Gregory C. Lewin

 
 
 

newbie: setting PATH in .profile

Post by Silviu Minu » Mon, 12 Jul 1999 04:00:00


source .profile

for the changes to take effect for that particular shell only.
The changes take effect for all shells the next time you log in.


> This should be an easy one, but I'm new to this, and apparently not as
> bright as I once was. Anyway, I'm running COL2.2 and the "bash" shell. I
> want to add a reference to my $HOME and working directory to my PATH, so,
> like the book says, I added the following to my .profile file in my home
> directory:

> PATH=$PATH:$HOME:
> export PATH

> But it doesn't work! What gives? I know it's calling the lines, because I
> added an echo "Hello!" line right after the export, and when I enter
> .profile, it says Hello! (I have no idea how to see if this executes
> during login, but it works from the command line).

> Any thoughts?

> Gregory C. Lewin



 
 
 

newbie: setting PATH in .profile

Post by Villy Kru » Mon, 12 Jul 1999 04:00:00




Quote:>But it doesn't work! What gives? I know it's calling the lines, because I
>added an echo "Hello!" line right after the export, and when I enter
>.profile, it says Hello! (I have no idea how to see if this executes
>during login, but it works from the command line).

The modified PATH is lost again if you run .profile in a subshell.  If
you want to avoid this do.

. ./.profile

Note that if the file .bash_profile exists then bash might use this
rather than .profile when you log in.

Villy

 
 
 

newbie: setting PATH in .profile

Post by Gregory C. Lewi » Mon, 12 Jul 1999 04:00:00


OK, that makes sense. This works when I log in to the command line
interface (e.g., in COL2.2, I hit C-A-F2, and login as normal). However,
when I log in using the login screen (thereby going directly into KDE), it
doesn't work. Hmmmm...  Is .profile called in the KDE startup?

Thank you very much for your help. I appreciate it.


> source .profile

> for the changes to take effect for that particular shell only.
> The changes take effect for all shells the next time you log in.


> > This should be an easy one, but I'm new to this, and apparently not as
> > bright as I once was. Anyway, I'm running COL2.2 and the "bash" shell. I
> > want to add a reference to my $HOME and working directory to my PATH, so,
> > like the book says, I added the following to my .profile file in my home
> > directory:

> > PATH=$PATH:$HOME:
> > export PATH

> > But it doesn't work! What gives? I know it's calling the lines, because I
> > added an echo "Hello!" line right after the export, and when I enter
> > .profile, it says Hello! (I have no idea how to see if this executes
> > during login, but it works from the command line).

> > Any thoughts?

> > Gregory C. Lewin


Gregory C. Lewin

 
 
 

newbie: setting PATH in .profile

Post by Justin B Willough » Mon, 12 Jul 1999 04:00:00



Quote:> OK, that makes sense. This works when I log in to the command line
> interface (e.g., in COL2.2, I hit C-A-F2, and login as normal). However,
> when I log in using the login screen (thereby going directly into KDE), it
> doesn't work. Hmmmm...  Is .profile called in the KDE startup?

If you are using the bash shell it will not read .profile (for example in an
xterm). bash does read .bashrc however in this.

You might want to try to just make a symbolic link between your .profile &
.bashrc

ln -s ~/.profile ~/.bashrc

Cheers,

- Justin
--
   _/     _/_/_/  _/    _/  _/    _/ _/   _/   RULES!! * LINUX RULES *
  _/       _/    _/_/  _/  _/    _/   _/_/     Justin Willoughby
 _/       _/    _/  _/_/  _/    _/     _/      http://justinw.net
_/_/_/ _/_/_/  _/    _/  _/_/_/_/    _/ _/     ---- Jesus Is Lord ----

 
 
 

1. *PATH settings should go in .profile or .kshrc?

Where should PATH, CLASSPATH, LD_LIBRARY_PATH and other such environment
definitions be defined? Should they live in .profile or .kshrc? And why?

Best regards,

Chris Morgan

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. Real NAT on RH60 ???

3. cvs mailing list? - and some questions

4. Window Maker & SuSE 8.1 oddities

5. ksh (88/93), setting of PATH in ~/.profile

6. Link to an object.

7. *PATH settings should go in .profile or .kshrc?

8. set path = "$path" hoses path in tcsh -- why???

9. Newbie Question:how to set path?

10. Newbie Question: Where does PATH get set?

11. a newbie question -how to set my own lib and include path