Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: modifying $PATH, path resets with startx?< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 10 2004,19:08 QUOTE

I noticed something unusual in DSL....at least it's unusual from what I've seen in other distros.

I attempted to add a directory to my path so that it is useable from all shells, but it seems that when you startx, the path gets reset.

Normally I'd add this line to ~/.bash_profile:
export PATH="/new/path:$PATH"
and then source ~/.bash_profile and startx.  After that, the new path is available from anything.

However, when I tried this in DSL, it affected only the one shell (tty).  I did startx, and checked my path from an x term, and it didn't show the new path.  I also tried to export the path from the console, and then startx...same thing happend.  It seems like the only way to modify the path is temporarily changing it for a specific shell.  This isn't normal, and it's rather annoying.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Sep. 10 2004,22:33 QUOTE

mikshaw, I noticed the same thing when I was trying to add export commands to a bash script and they were gone when the script ended.  I remember reading that that's normal with shell scripts, wether or not it's true with shells as a rule too, I don't know.
Back to top
Profile PM 
ke4nt1 Offline





Group: Members
Posts: 2329
Joined: Oct. 2003
Posted: Sep. 10 2004,22:49 QUOTE

What happens when you change the .bash_profile in /etc/skel ?

73
ke4nt
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 10 2004,23:23 QUOTE

Quote (clacker @ Sep. 10 2004,18:33)
mikshaw, I noticed the same thing when I was trying to add export commands to a bash script and they were gone when the script ended.  I remember reading that that's normal with shell scripts, wether or not it's true with shells as a rule too, I don't know.

I'm not sure that's so unusual, depending on the circumstances.  If you have an export command in a script, and the script ends, the variable is removed along with that shell.
If, however, you export from a script, and from that same script you launch an application, the variable will be passed to that application.  It will then disappear when that application closes, unless it passes the variable on to a new application (which will need to be launched from the same string).  It's like a circuit...you can pass the variable as long as the connection is there.  Once you break that circuit, the variable is cut off.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 10 2004,23:28 QUOTE

Quote (ke4nt1 @ Sep. 10 2004,18:49)
What happens when you change the .bash_profile in /etc/skel ?

73
ke4nt

I haven't tried that, but as far as I know the contents of /etc/skel are not "in effect"...they're there as a collection of generic files that are copied when a new user is created, but they aren't actually used in daily activities.

edit:  but...i wonder if the files in /home/dsl are created from /etc/skel at boot time.  If this is the case, I could backup /etc/skel/bash_profile and have the path already fixed....hmmm...

edit2: that still doesn't make sense, though.  ~/.bash_profile is a login script which in turn launches X.  If you have a variable exported from that shell, and then start an X session from that shell, the variable should be passed on


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
5 replies since Sep. 10 2004,19:08 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: modifying $PATH

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code