tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Summary: Contents of /etc/TIMEZONE file
@ 1996-10-27 13:29 Aharon Schkolnik
  0 siblings, 0 replies; only message in thread
From: Aharon Schkolnik @ 1996-10-27 13:29 UTC (permalink / raw)
  To: tru64-unix-managers


Hi.

My original questions:


    >>  Hi.
    >> 
    >> I'm using a perl module which needs to determine my
    >> timezone. It first tests the variable TZ, if that is not
    >> defined, it checks of /etc/TIMEZONE exists, if so, it does:
    >> 
    >> grep ^TZ /etc/TIMEZONE
    >> 
    >> 
    >> Now, my /etc/TIMEZONE file is empty, which causes the above
    >> grep to return nil, which causes the perl program to fail. Of
    >> course, one could expect the perl program to check if it gets
    >> something reasonable back from the grep, but that is not the
    >> point, because if /etc/TIMEZONE doesn't exist, it uses GMT,
    >> which is not correct.
    >> 
    >> So, my questions are:
    >> 
    >> 1. should /etc/TIMEZONE be empty, and if not, what should it
    >> contain.
    >> 
    >> 2. how do I set TZ to the " correct vaule". By this I mean, if
    >> I do date, I get
    >> 
    >> Sun Oct 13 11:09:09 IST 1996
    >> 
    >> 
    >> which correctly shows IST. Thus, the system knows that my
    >> timezone is IST. In order to get the perl program to also know
    >> this, I must either get this info into /etc/TIMEZONE, or into
    >> TZ. Of course, I realize that I can simply put TZ=IST;export TZ
    >> into my .profile (that's what I'm doing now), but I do not want
    >> to require each user on my system to do that - it should be set
    >> on a system level.
    >> 
    >> I just noticed that /etc/profile contains the line
    >> . /etc/TIMEZONE. Does that mean that I should put the command
    >> 
    >> TZ=IST;export TZ
    >> 
    >> in /etc/TIMEZONE ?
    >> 
    >> If so, how do I do that for all the different shells ?
    >> 
    >> Otherwise, do I have to put the correct command in each shells
    >> initialization file (using the appropriate syntax) ?
    >> 




Answers:




>>>>> "Harald" == Harald Lundberg <hl@tekla.fi> writes:

    >> 1. should /etc/TIMEZONE be empty, and if not, what should it
    >> contain.

    Harald> DU uses an alternate (better) method. Actually most Unixes
    Harald> use this newer method nowadays, but I think TZ will
    Harald> override. So don't set TZ.  If you just want to find out
    Harald> the name of the timezone, use 'date +%Z'.  The timezone is
    Harald> set by creating a link called 'localtime' in
    Harald> /etc/zoneinfo, pointing to a timezone file (binary,
    Harald> compiled with zic, sources are in the sources/
    Harald> subdirectory).




Summary:

	1. /etc/TIMEZONE should be empty - see above.
	2. can use TZ=`date +%Z` in each shell's startup file
(.profile)
	3. I wrote to the author of the perl script which was giving
me problems - he added the `date +%Z` code to the script.



Thanks also to:

>>>>> "Serge" == Serge Munhoven <munhoven@olive.msm.ulg.ac.be> writes:
>>>>> "Tom" == Tom Rioux <rioux@ip6480nl.ce.utexas.edu> writes:
>>>>> "Steve" == Steve Thompson <smt@NICS1.CORNING.COM>
>>>>> "skinner" == skinner  <skinner@zko.dec.com>



--
  The day is short, and the work is great,     |   Aharon Schkolnik
  and the laborers are lazy, and the reward    |   Aharon@Matat.Health.Gov.IL
  is great, and the Master of the house is     |
  impatient. - Ethics Of The Fathers Ch. 2     |

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-10-27 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-27 13:29 Summary: Contents of /etc/TIMEZONE file Aharon Schkolnik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox