LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-24-2013, 02:19 AM   #1
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Rep: Reputation: Disabled
echo $TZ printing nothing


Dear All,

I am using a 64 bit machine its amazon ec2 machine.
i did this to set the timezone

cp -v --remove-destination /usr/share/zoneinfo/Asia/Calcutta /etc/localtime

but when i do echo $TZ it is printing null.

Can anyone tell me why this is happening.

Thanks
Gajanan Hiroji
 
Old 06-24-2013, 02:28 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

are you sure this is the correct way to change the timezone? What OS is running on the ec2 instance?

Also, you shouldn't expect the value of TZ to change in the existing shell: you should at least open a new shell.

Evo2.
 
Old 06-24-2013, 02:38 AM   #3
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Dear Evo2

Last time also i have changed the TZ in same way. Its linux 64 bit machine.
 
Old 06-24-2013, 02:45 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by gajananh999 View Post
Last time also i have changed the TZ in same way.
Ok...

Quote:
Its linux 64 bit machine.
Can you be more specific about the OS? Eg what is the output of:
Code:
lsb_release --all
Evo2.
 
Old 06-24-2013, 02:48 AM   #5
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Here It is


$ lsb_release --all
LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.4 (Carthage)
Release: 5.4
Codename: Carthage

Gajanan
 
Old 06-24-2013, 03:09 AM   #6
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Can Anyone please reply me on this.
 
Old 06-24-2013, 03:13 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

ok, so it seems to be a RHEL 5.4 rebuild/clone. So what you did should work for setting the timezone, but you should not necessarily expect the TZ environment variable to be set in your shell. Furthermore, if TZ was not set before you changed /etc/timezone, the is no reason to expect it to be set after you changed /etc/timezone.

Do you get the expected Calcutta time when you run date?

Evo2.
 
Old 06-24-2013, 05:01 AM   #8
gajananh999
Member
 
Registered: Aug 2012
Posts: 94

Original Poster
Rep: Reputation: Disabled
Dear EVo2

Yes i get calcutta time.
 
  


Reply

Tags
timezone



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grep | xargs -I echo $(foo; bar; echo $(fee; fi; fo; fum)) == questionable output.. GrapefruiTgirl Programming 11 12-07-2010 07:02 PM
Printing the return value using 'echo $?' command wikiban Linux - Newbie 1 08-03-2009 02:16 PM
ls | echo, I got blank, why can't echo take the 2nd seat in a pipeline? elinuxqs Linux - Newbie 6 11-24-2006 08:25 AM
Kphone echo (echo echo) scabies Linux - Software 0 10-18-2004 02:59 PM
Echo /devPrinting doesn't work, echo /usb/lp0 works, Testpage works, Printing doesn't Hegemon Linux - General 3 08-15-2002 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration