Operating System - HP-UX
1833013 Members
1848 Online
110048 Solutions
New Discussion

BASH doesn´t read .profile i flogging into CDE-session

 
SOLVED
Go to solution
Joakim Brosten
Frequent Advisor

BASH doesn´t read .profile i flogging into CDE-session

Hi,

On our HP-UX 11.23 I´ve installed bash 2.05b, (from the incl. DVD´s). If I log in to the system using telnet, bash reads /etc/profile and ~/.profile but if I use the graphical CDE it seems like all I get is the default bash environment without the additions I have inkluded in my ~/.profile.
Have I missed something? Thanks for your help.

/J
5 REPLIES 5
Robert-Jan Goossens
Honored Contributor

Re: BASH doesn´t read .profile i flogging into CDE-session

Hi J,

Could you check your $HOME/.dtprofile and look if the line DTSOURCEPROFILE=true is uncommented ?

regards,
Robert-Jan
Mark Grant
Honored Contributor
Solution

Re: BASH doesn´t read .profile i flogging into CDE-session

Yes,

CDE doesn't read the .profile by default as well it shouldn't because any interactive commands in the .profile would hang the desktop.

THere are a few alternatives. Use .bashrc instead which gets read each time a new bash shell is started. Or, use the "-ls" flag to your terminal emulator e.g. xterm which also makes it a login shell and read .profile. You could put your environment stuff in $HOME/.dtprofile. FInally you could change DTSOURCEPROFILE=true in /usr/dt/config/sys.dtprofile
Never preceed any demonstration with anything more predictive than "watch this"
Robert-Jan Goossens
Honored Contributor

Re: BASH doesn´t read .profile i flogging into CDE-session

Joakim Brosten
Frequent Advisor

Re: BASH doesn´t read .profile i flogging into CDE-session

Hello again,

I tried to uncomment the line "DTSOURCEPROFILE=true " but it didn't help. But if after copied my "~/.profile" to ~/.bashrc it seems to work fine. The man-page says: "When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists.", so I guess that a CDE-session is not handled like an interactive login shell.

Anyhow, thank you for the tip and the fast answer Robert-Jan.

Best regards: /Jocke
Mike Stroyan
Honored Contributor

Re: BASH doesn´t read .profile i flogging into CDE-session

The CDE login will source $HOME/.bash_profile if you set "DTSOURCEPROFILE=true". You can see the mechanism in the script "/usr/dt/bin/Xsession".