problem with displaying date and adding time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting problem with displaying date and adding time
# 1  
Old 10-10-2008
problem with displaying date and adding time

Hi,
I have a log file with contents like

81.49.74.131 - - [14/Sep/2008:07:19:55 +1000]
81.49.74.131 - - [14/Sep/2008:07:25:55 +1000]
116.112.52.31 - - [15/Sep/2008:07:28:36 +1000]
116.112.52.31 - - [15/Sep/2008:07:28:37 +1000]

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.

Thanks in advance
# 2  
Old 10-10-2008
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding user name to file, and then displaying new line number

Hi all - I'm completely stumped by a script I'm working on... The short version is I have a file called 'lookup' and in it are hundreds of names (first and last). I have a script that basically allows the user to enter a name, and what I need to have happen is something like this: Record... (8 Replies)
Discussion started by: sabster
8 Replies

2. UNIX for Advanced & Expert Users

Problem with adding date

Hi All, Please let me know the error in the below code. m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) M=$(date +%m) Y=$(date +%Y) if ; then M=01 Y=$(($Y+1)) else M=$M+1)printf "01-%s-%d\n" ${m} $Y fi Log: + m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) ++... (4 Replies)
Discussion started by: kiranparsha
4 Replies

3. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies

4. Shell Programming and Scripting

Adding time to date time in UNIX shell scipting

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... (3 Replies)
Discussion started by: codehelp04
3 Replies

5. UNIX for Dummies Questions & Answers

Adding hours and minutes to current date (Only to date not to time)

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)
Discussion started by: manojgarg
4 Replies

6. Shell Programming and Scripting

Adding date and time to file name

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)
Discussion started by: cc_at_work
7 Replies

7. Programming

Date time problem while executing perl script.

Hi All, This Monday 15th March 2010, i have faced a weired issue with my Perl script execution, this script is scheduled to run at 1 minute past midnight on daily basis ( 00:01 EST ) generally for fetching previous business date , say if it is Monday it should give last Friday date, for Tuesday... (0 Replies)
Discussion started by: ravimishra
0 Replies

8. Shell Programming and Scripting

Date time problem

Hi Guys, I have a file a.txt Start Date/Time End Date/Time from Prob_Dura. ----------------- ----------------- ----- ------ 20090525 23:58:59 20090526 00:00:00 machine1 000051 20090525 23:58:09 20090526 00:00:11 machine2 000150 The perl or shell script can: 1. remove... (4 Replies)
Discussion started by: jimmy_y
4 Replies

9. UNIX for Dummies Questions & Answers

Adding Date & time stamps to filename

I need to edit the file name with date and time while writing the script. please help. (1 Reply)
Discussion started by: manish.s
1 Replies

10. UNIX for Dummies Questions & Answers

Adding date and time to a log file

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)
Discussion started by: ltodd2
2 Replies
Login or Register to Ask a Question