1834665 Members
1979 Online
110069 Solutions
New Discussion

TZ difficulty for csh

 
Marc Ahrendt
Super Advisor

TZ difficulty for csh

problem:
at times when users with the /usr/bin/csh shell login to our L2000 running 11.00 the date command is 3 hours off. time is not the problem since NTP is running properly, but the timezone is a problem.

my unsuccessful fix:
i was hard to investigate because users would complain, logout, inform me, login back in, and then the date was giving the correct time again. finally i was able to have a user contact me as it was happening. and below is what i did a month ago but then today another user brought the issue to my attention!!!
date
Tue Jul 10 00:34:15 EDT 2001
env | grep TZ
TZ=
NOTE: i see that the TZ is not set to PST8PDT ...we are in Portland Oregon
su
cp -p /etc/csh.login /tmp
vi /etc/csh.login
diff /tmp/csh.login /etc/csh.login
< setenv TZ `/usr/bin/sh -c '. /etc/TIMEZONE ; echo $TZ' ` # set the TZ variable
> setenv TZ `cat /etc/TIMEZONE | line | sed -e 's/TZ=//'`
< setenv TZ MST7MDT # change this for local time.
> setenv TZ PST8PDT
NOTE: this should of done the trick! in my opinion cat is more reliable than using a /usr/bin/sh when trying to login/setup a /usr/bin/csh user

question:
why didn't the above work? looking further into this last complaint i notice that the user has a $HOME/.login file but it contains just one line
cat $HOME/.login
#!./frog.sh
NOTE: there is no file $HOME/frog.sh
also i looked at the user's $HOME/.cshrc and found no refernce of TZ
fgrep TZ .[a-z]*
NOTE: returned nothing
thx for taking the time to consider my concern...
hola