Operating System - HP-UX
1829265 Members
9606 Online
109988 Solutions
New Discussion

Automatically Executing .PROFILE when using XTERM

 
oradba
Occasional Contributor

Automatically Executing .PROFILE when using XTERM

How can I automatically execute .PROFILE when I open up a new XTERM window.

I am using Korn Shell.
2 REPLIES 2
Cody Godines_1
Occasional Advisor

Re: Automatically Executing .PROFILE when using XTERM

Hi there,

This should do it:

xterm -ls

-Cody G
Bill Hassell
Honored Contributor

Re: Automatically Executing .PROFILE when using XTERM

xterm -ls works fine but the problem is likely due to using CDE or VUE to start terminal windows. The designers for these window managers decided that xterm (or dtterm or hpterm) should start without a 'normal' login (don't ask, no one will admit knowing).

You could edit the window manager config files but I prefer to make sure that all methods to start the terminal emulator(s) will perform a true Unix login and run /etc/profile, then .profile (and if setup, .kshrc, etc). In that case, you can create a file in your $HOME directory called .Xdefaults. For each user of the system, have them do this one time:

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

and now xterm (and dtterm and hpterm) will always login 'normally'.


Bill Hassell, sysadmin