03-19-2008
Script to convert GMT to Asia/Hong Kong time
hi friends,
this is my first time with this type of script so please pardon my ignorance. i have this script in which a piece of code needs to be added which can have the Asia/Hong kong time as well. system date and format is GMT so no problem with GMT and even EST is covered..i have ato add new File watchers and that requires an update to the following script to support Asia time as well.
#!/bin/sh
LOGS=/etdhub-as1/apps/home/pcent/informatica/logs
EDATE=`date "+%Y%m%d_%T"`
BIN=/etdhub-as1/apps/home/pcent/informatica/Scripts
UNIXSERVER=etdhub-as1-p.prd.etsd.ml.com
ETC=/etdhub-as1/apps/home/pcent/etc
TMP=/etdhub-as1/apps/home/pcent/tmp
export LOGS EDATE BIN UNIXSERVER ETC TMP
WOMBATDIR=/gfs/data/.../prod/wombatsymbolfiles/1.0
SRCDIR=/gffgf/apps/home/pcent/informatica/SrcFiles/OPTIONS_Delivery
ROPADIR=/gfs/data/sss/prod/ropa/1.0
LIFDIR=/gfs/data/sss/raw/liffe
FOWDIR=/gfs/data/sss/prod/fowtradedata
GMTDATE=`date "+%Y%m%d"`
GDATE=`date "+%Y%m%d_%T"`
GYEAR=`date "+%Y"`
GMONTH=`date "+%m"`
GDD=`date "+%d"`
TAIWANDIR=/gfs/data/sss/raw/taiwandata
TDATE=`date "+%Y%m%d"`
TYEAR=`date "+%Y"`
TMONTH=`date "+%m"`
TDD=`date "+%d"`
export WOMBATDIR SRCDIR ROPADIR GDATE GYEAR GMONTH GDD FOWDIR LIFDIR GMTDATE TAIWANDIR TDATE TYEAR TMONTH TDD
STOCKLOANDIR=/gfs/data/sss/raw/stockloan
SDATE=`date "+%Y%m%d"`
SYEAR=`date "+%Y"`
SMONTH=`date "+%m"`
SDD=`date "+%d"`
any help would be much appreciated..
9 More Discussions You Might Find Interesting
1. Solaris
Hi,
In solaris how to change the timezone to display to HKT
I tried by putting TZ=Hongkong or TZ=Asia/Hong_kong
but it is taking me to the display of CST.
how to change it to HKT
thanks
Bala (1 Reply)
Discussion started by: Balamurugan
1 Replies
2. HP-UX
I want to know how to change the time zone from BST to GMT avoid the daylight savings in hp-ux (3 Replies)
Discussion started by: tomjones
3 Replies
3. Shell Programming and Scripting
Hi,
What i am looking for and i am new to this too, is a bash script that will add time in the format hh:mm:ss and produce the answer in minutes or seconds. It needs to be a loop since there are hundreds of times in my file. This is data is from a CDR that calculates duration of time used. ... (2 Replies)
Discussion started by: trotella
2 Replies
4. Solaris
Any help appreciated. I am connecting (FTP) to a NAS PRO box that is currently installed on one of our subnets in Hong Kong from a Solaris
system running Solaris 10 (our backup server). The NAS box has a backup job that backs up all user documents locally. I am trying to ftp the docs from the NAS... (4 Replies)
Discussion started by: jamba1
4 Replies
5. Shell Programming and Scripting
Dear experts,
I have an epoch time input file such as : -
1302451209564
1302483698948
1302485231072
1302490805383
1302519244700
1302492787481
1302505299145
1302506557022
1302532112140
1302501033105
1302511536485
1302512669550
I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies
6. Post Here to Contact Site Administrators and Moderators
Dear All,
Today, somewhere around 7:30 GMT (2:30 PM Eastern Time) www.unix.com will go down for what we hope is around 15 - 20 minutes as we change out some hardware on the server.
Thank you for your patience and support.
Neo (0 Replies)
Discussion started by: Neo
0 Replies
7. Shell Programming and Scripting
How can I convert the following date format:
New Log Date = 2016-12-30 23:50:33 GMT
from GMT time to local time?
Thanks (13 Replies)
Discussion started by: mrn6430
13 Replies
8. Shell Programming and Scripting
Gents,
Please can help with this.
the column in red is the local time
the column in blue is the GPStime
4153152529951 2/12/17 12:00:04.980 951 2960 41531.0 52529.0 1170882022980002
4108153261942 2/12/17 12:00:07.944 942 2959 41081.0 53261.0 1170882025944002
41511523611660... (7 Replies)
Discussion started by: jiam912
7 Replies
9. Solaris
I need away to convert the following GMT date and time value RAW_TME= 042720171530 "mmddccyyhhmm" to Localhost time. In this case it is in central time.
Here is what I came up with but it does not look efficient:
RAW_TME=042720171530
logmm=`echo $RAW_TME | cut -c1-2`
logdd=`echo $RAW_TME |... (4 Replies)
Discussion started by: mrn6430
4 Replies
LEARN ABOUT REDHAT
script
SCRIPT(1) BSD General Commands Manual SCRIPT(1)
NAME
script -- make typescript of terminal session
SYNOPSIS
script [-a] [-f] [-q] [-t] [file]
DESCRIPTION
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive
session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript.
Options:
-a Append the output to file or typescript, retaining the prior contents.
-f Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can super-
vise real-time what is being done using `cat foo'.
-q Be quiet.
-t Output timeing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time
elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used
to replay typescripts with realistic typing and output delays.
The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not
set) for the C-shell, csh(1)).
Certain interactive commands, such as vi(1), create garbage in the typescript file. Script works best with commands that do not manipulate
the screen, the results are meant to emulate a hardcopy terminal.
ENVIRONMENT
The following environment variable is utilized by script:
SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most
shells set this variable automatically).
SEE ALSO
csh(1) (for the history mechanism), replay(1).
HISTORY
The script command appeared in 3.0BSD.
BUGS
Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
Linux July 30, 2000 Linux