Operating System - HP-UX
1833748 Members
2773 Online
110063 Solutions
New Discussion

Re: .profile will not be read

 
SOLVED
Go to solution
Zlatko_1
Occasional Advisor

.profile will not be read

After logging into CDE, if I open a dtterm, my .profile will not be read, but if I open a console, my .profile will be read ( or just su - user ).

I checked my .dtprofile and uncomment "DTSOURCEPROFILE=true", but this doesn't work.
And to put ". ./.profile" at the end of .dtprofile doesn't work also.
4 REPLIES 4
Armin Feller
Honored Contributor

Re: .profile will not be read

Maybe the problem is that the environment variable that should be set is SHENV rather then ENV as documented. Set this variable in ~/.profile as
follows:

SHENV=/doug/.profile
export SHENV

This will set the environment variabl and export it for other shells. The ~/.profile will then execute for all shells.
T G Manikandan
Honored Contributor

Re: .profile will not be read

check using the -ls option to the dtterm when invoking it.

#dtterm -ls

revert
Armin Feller
Honored Contributor
Solution

Re: .profile will not be read

RESOLUTION
You can force the system to sources these files by enabling the "loginShell" resource for each of the terminal emulator windows.

To do this on a system-wide basis you will need to create the sys.resources file in the /etc/dt/config/C/ directory and add the following line to this new resource file:

*loginShell: true

The permissions on this file should be 644 :

/usr/bin/chmod 644 /etc/dt/config/C/sys.resources

NOTE: If this file already exists, this resource line can be added to the end of the existing file.

To do this on a per-user basis you will need to create the .Xdefaults file in the user's $HOME directory and add the following line to this new resource file:

*loginShell: true

The permissions on this file should be 644 :

/usr/bin/chmod 755 $HOME/.Xdefaults

NOTE: If this file already exists, this resource line can be added to the end of the existing file.

Both of these changes will take effect with the next login to CDE.

EXPLANATION
The *loginShell resource configures the terminal emulators (Dtterm, HPterm, XTerm) to behave as if the user has 'telnet'-ed or 'rlogin'-ed into the system.

This incorporates the default sequence of reading the /etc/profile and similar files when each new terminal window is opened. Therefore, the environment in the shell window will NOT be the same as as that of the standard CDE session (/usr/dt/bin/dtsession).
Zlatko_1
Occasional Advisor

Re: .profile will not be read

Armin,
....You Are The Greatest ! ...

Thank you.