Operating System - HP-UX
1748139 Members
3819 Online
108758 Solutions
New Discussion юеВ

Re: cde not sourcing .profile

 
SOLVED
Go to solution
BenIsCool
Frequent Advisor

cde not sourcing .profile

Hello,

When I log into CDE on hpux 11.11 and start an xterm, my .profile is not executed.
I know about the .dtprofile last line and I have uncommented it but it is not sourcing my home folder .profile.
I know this has worked for me in the past.
What am I missing?
Thanks
9 REPLIES 9
Robert-Jan Goossens
Honored Contributor

Re: cde not sourcing .profile

Hi,

# cd $HOME
# vi .dtprofile
uncomment the last line
DTSOURCEPROFILE=true
:wq!

exit CDE and login again.

Regards,
Robert-Jan
BenIsCool
Frequent Advisor

Re: cde not sourcing .profile

Hello,

That is the problem. I have already done that:

>> I know about the .dtprofile last line and I have uncommented it but it is not sourcing my home folder .profile.

It is making a difference- my PS1 is different when dtsourceprofile is uncommented. But, for example, I have created some aliases in my .profile and they are not being read.

Thanks
Dennis Handly
Acclaimed Contributor

Re: cde not sourcing .profile

>I have created some aliases in my .profile and they are not being read.

Aliases in .profile would typically be lost when you invoke a new shell. They belong in your ENV file.
export ENV='${FILE[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'
export FILE=$HOME/.ksh_rc
BenIsCool
Frequent Advisor

Re: cde not sourcing .profile

ok.

What about exported variables (ie. HISTSIZE), umask settings, and echo statements?

I have all of those in my .profile and none are reflected.

Thanks
Dennis Handly
Acclaimed Contributor

Re: cde not sourcing .profile

>I have all of those in my .profile and none are reflected.

Hmm, do you have to create a login shell when you open the xterm?

I would think this is related to the fact that xterm has nothing to do with CDE and it wants you to create dtterms.

But xterm takes: -ls
BenIsCool
Frequent Advisor

Re: cde not sourcing .profile

There we go. Thats right. Well, either xterm or dtterm, doesn't matter. Neither references .profile without the -ls.

You are right.

I can create a new "launcher" for dtterm that has -ls and that works.

Do you know how I can modify the dtterm that is on the CDE front panel by default?

Thanks
Bill Hassell
Honored Contributor
Solution

Re: cde not sourcing .profile

Xwindow terminal emulators have historically ignored 'normal' Unix login profiles since the beginning. The reason could probably be traced to badly written /etc/profile and .profile scripts but that was 20 years ago...the tradition continues.

DTSOURCEPROFILE is bad solution because it bypasses /etc/profile. To make all your terminal emulators (xterm, hpterm, dtterm) login normally, do this one time on each machine where you run an Xwindow emulator:

echo "*loginShell: true" >> $HOME/.Xdefaults

Now when you start a new terminal window, you see a 'normal' login starting with /etc/profile and then .profile when you login.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: cde not sourcing .profile

Ah, the way I do it is that every window always rlogins (ssh real soon) into some other server.
Alex Glennie
Honored Contributor

Re: cde not sourcing .profile

Problem revolves around default behavior of dtterm,xterm etc

To resolve :

Vi $HOME/.Xdefaults and add :

*LoginShell : True

or set in /usr/dt/app-defaults/C/Dtterm etc ...