11-22-2013
Huh, that is a large difference. Check what the $4 " " $5 " 00" actually becomes? awk's mktime() expects "YYYY MM DD HH MM SS"
[edit] Add a sub(/-/, " ", $4); statement to the program, the dashes are probably confusing it.
Running GNU date 9,000 times is not going to be very efficient at all. if you have mktime() in awk it's best to use it.
Last edited by Corona688; 11-22-2013 at 03:51 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello gurus,
i want a perl/shell script which once invoked should convert a set of EPOCH timestamps to local time ( IST..i want) .
how does it work ,i have an idea on that..but writing a perl/shell script for it is not possible for me...so i need help for the same.
my exact requirement is... (2 Replies)
Discussion started by: abhijeetkul
2 Replies
2. Programming
Hi all,
I'm after some help with this small issue which i'm struggling to work out a fix for.
I have a file that contains records that all have a time stamp for each individual record, i need to search the file for a specific time stamp and then search back 10 seconds to see if the number... (2 Replies)
Discussion started by: sp3arsy
2 Replies
3. Shell Programming and Scripting
I am trying get time difference of two dates in secs. Initially I want to convert a standard date format to epoch for two dates and then subtract the two epoch dates.
Example :
date -d "2007-09-01 17:30:40" '+%s'
But this gives me below error
date: illegal option -- d
Usage: date
OS: AIX... (6 Replies)
Discussion started by: bpaac
6 Replies
4. Shell Programming and Scripting
Hello Expert,
I need to transpose Date-Timestamp based on same column values and calculate time difference. The input file would be as below and required output is mentioned in the bottom
INPUT File
========
08/23/2012 12:36:09 JOB_5340
08/23/2012 12:36:14 JOB_5340
08/23/2012... (2 Replies)
Discussion started by: asnandhakumar
2 Replies
5. Shell Programming and Scripting
Below is the sample file:
287 DEBUG syndesis.pb.util.ITraceManager - syOID=ELntNetwork:1005Mon Oct 15 17:18:21 IST 2012 <ELClientManagerenEmsSession() > Setting Java Properties
287 DEBUG syndesis.pb.util.ITraceManager - syOID=ELntNetwork:1005Mon Oct 15 17:18:21 IST 2012... (1 Reply)
Discussion started by: ashok.kumar
1 Replies
6. Shell Programming and Scripting
Hello All,
I have a Perl script I'm writing where I ask the user to enter a "start time" for something. The "$start_time" will be in the format of:
# The Time CLI Option Can be in the format of:
--start-time="1day"
--start-time="2hours"
--start-time="45min"
... (1 Reply)
Discussion started by: mrm5102
1 Replies
7. Shell Programming and Scripting
I have a requirement to find long running instances for notifying the stake holders based on the triggered time in AIX.
I am not sure how to convert the triggered time to epoch seconds.
For example :
Current triggered time of instance is 13:06:19 -> how to convert this into epoch in the... (5 Replies)
Discussion started by: chandu123
5 Replies
8. Shell Programming and Scripting
Hi All,
Firstly thank you for the forum members I need to find time difference b'w two rows of timestamp using awk/shell.
Here is the logfile:
cat business_file
start:skdjh:22:06:2010:10:30:22
sdfnskjoeirg
wregn'wergnoeirnfqoeitgherg
end:siifneworigo:22:06:2010:10:45:34... (3 Replies)
Discussion started by: Srinivas Gadi
3 Replies
9. Shell Programming and Scripting
I have a list of epoch times delimited by "-" as follows:
1335078000 - 1335176700
1335340800 - 1335527400
1335771300 - 1335945600
1336201200 - 1336218000
The corresponding dates are:
20120422 1000 - 20120423 1325
20120425 1100 - 20120427 1450
20120430 1035 - 20120502 1100 ... (3 Replies)
Discussion started by: alex2005
3 Replies
10. Shell Programming and Scripting
Hi All,
I have scenario where i have to compare two dates.
I thought of converting them to epoch seconds and do a numeric comparison.
This works fine on Linux systems.
$ date -d '2015/12/31' +%s
1451538000
$ date +%s
1449159121
But we don't have -d option in HPUX.
What would be... (5 Replies)
Discussion started by: veeresh_15
5 Replies
LEARN ABOUT OPENSOLARIS
sleep
sleep(1) User Commands sleep(1)
NAME
sleep - suspend execution for an interval
SYNOPSIS
/usr/bin/sleep
/usr/bin/sleep time
ksh93
sleep time
DESCRIPTION
/usr/bin/sleep
sleep suspends execution for at least the integral number of seconds specified by time.
ksh93
sleep suspends execution for at least the time in seconds specified by time or until a SIGALRM signal is received.
OPERANDS
/usr/bin/sleep
The following operands are supported for /usr/bin/sleep:
time time in seconds can be specified as a non-negative decimal integer number.
ksh93
The following operands are supported:
time Specify time in seconds as a floating point number. The actual granularity depends on the underlying system, normally around 1 mil-
lisecond.
EXAMPLES
Example 1 Suspending Command Execution
The following example executes a command after a certain amount of time:
example% (sleep 105; command)&
Example 2 Executing a Command Every So Often
The following example executes a command every so often:
example% while true
do
command
sleep 37
done
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of sleep: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 The execution was successfully suspended for at least time seconds, or a SIGALRM signal was received (see NOTES).
>0 An error has occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
/usr/bin/sleep
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|Standard |See standards(5). |
+-----------------------------+-----------------------------+
ksh93
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Uncommitted |
+-----------------------------+-----------------------------+
SEE ALSO
ksh93(1), wait(1), alarm(2), sleep(3C), wait(3UCB), attributes(5), environ(5), standards(5)
NOTES
If the sleep utility receives a SIGALRM signal, one of the following actions is taken:
o Terminate normally with a zero exit status.
o Effectively ignore the signal.
The sleep utility takes the standard action for all other signals.
SunOS 5.11 20 Nov 2007 sleep(1)