1825771 Members
2360 Online
109687 Solutions
New Discussion

traps with CDE

 
Carine Parmentier
Occasional Contributor

traps with CDE

I use a trap in my .profile to empty a logfile when sending the EXIT signal.
As long as I work in terminal session, it is executing the trap - when I use CDE, it is not executing the trap.
In the .dtprofile, DTSOURCEPROFILE=true is set.
Can someone help me to solve this small problem
Thanks
Carine
2 REPLIES 2
Stephen Keane
Honored Contributor

Re: traps with CDE

1. Be careful that your .profile doesn't contain any terminal specific code such as stty or $TERM. If it does you need to wrap it to protect it from the CDE.

e.g.

if [ ! "$DT" ]
then
term specific stuff like stty etc
fi

rest of stuff


2. Create a file $HOME/.Xdefaults (if it doesn't already exist). Add a line

*loginShell:TRUE

3. If you get an error on (1) complaining that DT is not set, you might have 'set -u' in your profile. If you do use 'set +u' just before the test and restore it with 'set -u' just after the test.

Steven E. Protter
Exalted Contributor

Re: traps with CDE

Better to set the environment variable in the .dtprofile

That way you don't mess up ssh/telnet users when they log onto the system.

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