I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as follows, but there appears to be an error in the function calling. I also wanted to check if this script designed by me is full proof.
---------- Post updated 11-30-12 at 12:07 AM ---------- Previous update was 11-29-12 at 10:40 PM ----------
Let me just elaborate on the variables used in the above code:
I hope this information makes it easier to understand the code and help me out in correcting/improvising it.
Last edited by Franklin52; 11-30-2012 at 04:42 AM..
Reason: Code tags
Hi,
I have a log file with contents like
81.49.74.131 - -
81.49.74.131 - -
116.112.52.31 - -
116.112.52.31 - -
I need an output like this
81.49.74.131 14/Sep/2008 Time duration: 00:06:00
116.112.52.31 15/Sep/2008 Time duration: 00:00:01
Please anyone suggest a script for this.... (1 Reply)
Morning all
Im hoping you can help me. We have a nice new oracle server :( and are needing to move some files around for EDI and BACS. The server runs windows but has an app called MKS toolkit installed which give unix commands. (Needed for the oracle stuff) I have had a go using dos commands... (2 Replies)
Hi guys,
I know that this topic has been discuss numerous times, and I have search the net and this forum for it.
However, non able to address the problem I faced so far.
I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Hi All,
i wanted to add date and time to the file names in the same directory so lets say a file in the directory is test.txt then after running the shell script it should be test-15-11-2010.txt.
So I used the following script which works,
#!/bin/bash
thetime=`date +%Y-%m-%d--%H:%M:%S`... (7 Replies)
I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk.
I tried
This is how each line of the file looks like, different date and time in this format
Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th
... (2 Replies)
Hi,
I want to add some hours and minutes to the current date. For example, if the current date is "July 16, 2012 15:20", i want to add 5 hours 30 minutes to "July 16, 2012 00:00" not to "July 16, 2012 15:20". Please help.
Thanks! (4 Replies)
I have a cluster of two Solaris server (veritas cluster). one working and the other is standby
I am going to change the date on them , and am looking for a secure solution as it is giving an important service.
my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
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)
There are 2 dates,
Tue Oct 1 13:40:19 2013
Sun Sept 30 10:26:23 2013
I have multiple dates like the above one. How do I calculate the date time difference and display in another column in Shell script. Please help. (3 Replies)