In general, when working with time like this, you convert current time(s) to the epoch time in seconds - ie. number of seconds since Jan 1 1970.
On linux (or if you have gnu date)
otherwise try perl
epoch_seconds is now a number like 1189706758 that you can add seconds to.
Hi All..
Does anyone have a useful function where I can enter two date/timestamps and it calculates the difference in time in hours, minutes and seconds between the 2?
Any feedback much appreciated. :D
Kind Regards
Satnam (1 Reply)
I am trying to do a shell script to monitor if any files went through in the last hour.
There is a script in cron that runs every sec checking to see if a file is there and ftp the file out of this folder.
Now I just want to add a block of code that will check to see no files went in the last... (3 Replies)
I have script that runs based on time variables passed in the command line. The first command argument is a timer, in seconds, of how often to execute a certain loop in the script. The second command argument is the end time of the script, in military time. Below is an example of the command line:... (1 Reply)
I am writting a script in the ksh shell and am trying to find a way to report the total execution time of the script without requiring the user to specify the time function when executing the script.
Does anyone have any examples they have used. I have been setting up two date variables (one at... (1 Reply)
hi all,
was wondering if there is another way to do calculations in ksh scripts other than using bc ?? i am using a script to calculate average response time and my script errors out after running for a bit.
e.g code i am using :
averageTime=$(print "$totalTime / $numberOfEntries" |... (2 Replies)
HI
i have following problem,
i need to use split command to split files each should be cca 700 lines but i dont know how to inplement it in the scripts becasuse each time the origin file will be various size ,
any body got any idea
cheers (2 Replies)
Hello,
I have to turn:
Apple Inc.:325,64:329,57
into
Apple Inc.:325,64:329,57:3,93
3,93=329,57-325,64.
My code:
cat beurs.txt | sed 's/\(*\):\(*\),*\(*\):\(*\),\(*\)/\4\.\5-\2\.\3/' beurs.txt | bc| tr '.' ',' | sed 's/^-*,/0,/' > winstmarges.txt; paste -d: beurs.txt winstmarges.txt; rm... (5 Replies)
grep Quality abc.txt | awk -F"=" '{print $2}'
o/p is given as
70/70
49/70
I want in the below format (percentage format)
100%
70%
help me!!!!:confused::confused::confused:
---------- Post updated at 09:59 AM ---------- Previous update was at 09:57 AM ----------
Cell 01 -... (3 Replies)
Hello. I'm writing an awk script that looks at a .csv file and calculates the weighted grade for each student based on the scores and categories in the file. I am able to get the script to run the only issue however is that the same score for each student is the same. I'm self-teaching myself the... (1 Reply)
Discussion started by: Eric7giants
1 Replies
LEARN ABOUT CENTOS
iso8601
PACEMAKER(8) System Administration Utilities PACEMAKER(8)NAME
Pacemaker - Part of the Pacemaker cluster resource manager
SYNOPSIS
iso8601 command [output modifier]
DESCRIPTION
iso8601 - Display and parse ISO8601 dates and times
OPTIONS
-?, --help
This text
-$, --version
Version information
-V, --verbose
Increase debug output
Commands:
-n, --now
Display the current date/time
-d, --date=value
Parse an ISO8601 date/time. Eg. '2005-01-20 00:30:00 +01:00' or '2005-040'
-p, --period=value
Parse an ISO8601 date/time with interval/period (wth start time). Eg. '2005-040/2005-043'
-D, --duration=value
Parse an ISO8601 date/time with duration (wth start time). Eg. '2005-040/P1M'
-E, --expected=value
Parse an ISO8601 date/time with duration (wth start time). Eg. '2005-040/P1M'
Output Modifiers:
-s, --seconds
Show result as a seconds since 0000-001 00:00:00Z
-S, --epoch
Show result as a seconds since EPOCH (1970-001 00:00:00Z)
-L, --local
Show result as a 'local' date/time
-O, --ordinal
Show result as an 'ordinal' date/time
-W, --week
Show result as an 'calendar week' date/time
For more information on the ISO8601 standard, see: http://en.wikipedia.org/wiki/ISO_8601
AUTHOR
Written by Andrew Beekhof
REPORTING BUGS
Report bugs to pacemaker@oss.clusterlabs.org
Pacemaker 1.1.10-29.el7 June 2014 PACEMAKER(8)