Operating System - HP-UX
1834480 Members
3721 Online
110067 Solutions
New Discussion

understanding /etc/profile

 
SOLVED
Go to solution

understanding /etc/profile

Hi,

I made a change in /etc/profile setting my primary promt. I thought that this file is read every time a user logs in (and so the prompt is set) but this does not happen on my machine.
Once my CDE-session has started and in a ksh I login as the same user again the change to the prompt is made.

What am I missing? I'm using HPUX 10.20 and a ksh.

Best regards,
Aleksandar Vujevic
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor

Re: understanding /etc/profile

Hi Alex,

Check your /$HOME/.dtprofile
uncomment the last line
DTSOURCEPROFILE=true

Hope this helps,
Robert-Jan
Mark Grant
Honored Contributor
Solution

Re: understanding /etc/profile

/etc/profile is only run when you log in. However, if you open a terminal window from within CDE, you are not actually logging in again. If you type "xterm -ls" you'll find you do get your PS1 set again because the "-ls" stands for "log in shell".

THe way around your problem is to change CDE so that when you start a terminal, it starts your favourite terminal emulator with a "-ls" argument.

Never preceed any demonstration with anything more predictive than "watch this"
Steven E. Protter
Exalted Contributor

Re: understanding /etc/profile

CDE on the machine itself via the graphics card is not going to use /etc/profile at all.

It uses a file called .dtprofile

Some of the newer X emulation packages like Hummingbird Exceed v9 does use /etc/profile. At least that appears to be the case with me, but its hard to tell what the factor is. We also have gnome 1.4 installed on all of our boxes as primary graphical environment.

Yet on the same box Exceed v7 does not read /etc/profile at all.

Interesting.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor

Re: understanding /etc/profile

Aleksandar,

Here's our .dtprofile:


DTSOURCEPROFILE=true
. /etc/profile;

This will guarantee that /etc/profile gets run in the CDE environment.


Pete

Pete
Jeroen Peereboom
Honored Contributor

Re: understanding /etc/profile

L.S.

I usually modify the file:
/usr/dt/app-defaults/C/Dtterm:
*loginShell: true

such that CDE uses '-ls' flag for dtterm. You must rebuild you CDE Home session, if you have one, or close all dtterms and logout if you use CDE with 'resume session' (or what is it called).

A disadvantage is that at the next OS upgrade you may loose the modification.

The advantage is that you only need to modify 2 systemwide files (/etc/profile and the file mentioned above).

JP.

Re: understanding /etc/profile

Many thanks to all! It was all helpful.

I personally like Jeroen's way best!

Aleks