Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debian

Status
Not open for further replies.

jeral

Technical User
Jan 21, 2006
2
US
I am using a program that requires it be run in a terminal. Out of several distros (Fedora Core 4, Red Hat 9 and Debian 3.1 r0a "Sarge") it works in all but Debian. For some reason, I can not get Debian to read the .bash_profile file. Any ideas would be much appreciated

Thanks
 
Are you using a terminal eulator from within X? If so, the problem is likely that none of the shells you open from X are ever considered login shells, and thus only read the [tt]~/.bashrc[/tt].

I'm really not sure of the "preferred" way to handle the problem, but what I did (on Debian Sarge) was to create a file [tt]~/.xsession[/tt] with these contents
Code:
#!/bin/sh
export PATH="`echo 'echo $PATH' |bash -sl`"
exec x-session-manager
and made it executable. ([tt]chmod +x ~/.xsession[/tt]).

That runs a login [tt]bash[/tt] shell (change it accordingly if you don't use [tt]bash[/tt]), makes it tell you the [tt]PATH[/tt], and exports it before running your usual X session manager.


Of course, a kludgier and slightly incorrect solution is to just set the [tt]PATH[/tt] in your [tt]~/.bashrc[/tt] file.
 
chipperMDW

Sorry, I forgot to mention that the terminal was opened in an X window.

Where should the ~/.xsession be placed? In the home directory?

There is also perhaps another option. When I ask for the path, " echo $PATH " I get /usr/local/bin as part of the path. I could always place the program there if all else fails.

 
[tt]~/[/tt] is shorthand for your home directory. So [tt]~/.xsession[/tt] is a file named [tt].xsession[/tt] in your home directory.
 
~ and ~user (where user is a user other than yourself) is useful and powerful (if other users allow read permissions on their files or your doing something as root -- be VERY careful with root if you have root access). You could also add

source .bash_profile

to your .bashrc

[plug=shameless]
[/plug]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top