Can any how we can find the time diffrence...?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can any how we can find the time diffrence...?
# 1  
Old 10-26-2007
Java Can any how we can find the time diffrence...?

Hi,
I am trying to caluate the time elasped by the job to run.For that i have used the following command:
I have one file which contains the following
more start.txt
991 STARTED Fri Aug 10 14:04:20 2007
Starting Job JOB_NAME. (...)
1036 STARTED Fri Aug 10 14:04:31 2007
Finished Job JOB_NAME.

From this file i am taking the timing by the following commands:
firsttime=`more start.txt |head -1 |cut -d' ' -f4`
secondtime=`more start.txt |tail -2 |cut -d' ' -f4`

-From this i have got two variable with valu as :
Firsttime=14:04:20
secondtime=14:04:31

---I want the diifrence og this ..means for how long this job was running...for this i have been using "expr" command it gives me folowing error:
timediff=`expr $secondtime - $firsttime`
expr: non-numeric argument

Can anybody help to find the time difference..any other command??
I am using korn shell.....Smilie
# 2  
Old 10-26-2007
this might help you
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Find gaps in time data and replace missing time value and column 2 value by interpolation in awk

Dear all, I am kindly seeking assistance on the following issue. I am working with data that is sampled every 0.05 hours (that is 3 minutes intervals) here is a sample data from the file 5.00000 15.5030 5.05000 15.6680 5.10000 16.0100 5.15000 16.3450 5.20000 16.7120 5.25000... (4 Replies)
Discussion started by: malandisa
4 Replies

2. Shell Programming and Scripting

what would a script include to find CPU's %system time high and user time high?

Hi , I am trying to :wall: my head while scripting ..I am really new to this stuff , never did it before :( . how to find cpu's system high time and user time high in a script?? thanks , help would be appreciated ! :) (9 Replies)
Discussion started by: sushwey
9 Replies

3. Shell Programming and Scripting

Find and Convert UTC Time to PST Time

Hello All - I have a script that grabs data from the net and outputs the following data 46029 46.144 -124.510 2010 07 26 22 50 320 4.0 6.0 2.2 9 6.8 311 1012.1 -0.9 13.3 13.5 13.3 - - 46041 47.353 -124.731 2010 07 26 22 50 250 2.0 3.0 1.6 8 6.4 - 1011.6 - ... (0 Replies)
Discussion started by: drexnefex
0 Replies

4. Solaris

Diffrence between stripping and mirroring

Hi All, What is the difference between stripping and mirroring? Thanks, Rafi. (3 Replies)
Discussion started by: rafidba.alvi
3 Replies

5. Shell Programming and Scripting

diffrence in executing a shell script

hi Could some one let me know what is the diffrence in executing a shell script as below $sh script.sh (this is executed in a subshell) $./script.sh(this is executed in the current shell) $script.sh(this is executed in a subshell) where script.sh is the name of the shell script. ... (1 Reply)
Discussion started by: sowjanya
1 Replies

6. Shell Programming and Scripting

time diffrence between two lines in a log file

Hi Experts, I am writing a shell/Perl script tp get a time diffrence of two lines in a log file. I am pasting a snippet of my log file, how it look likes. Sun Apr 26 02:11:03.162 2009 Greenwich Standard Time LOW: pid 488 tid 2072: 0: 251360: calling ARRF_LIB_Evaluate. Sun Apr 26... (24 Replies)
Discussion started by: namishtiwari
24 Replies

7. Shell Programming and Scripting

diffrence between .cshrc .login .profile

Hi.. i was just looking to know the diffrence between this three terms 1) .cshrc 2) .login 3) .profle but iam failed to findout the exact diffrent Please can any one share the diffrence between this regards Syed (1 Reply)
Discussion started by: smuqtaderali
1 Replies

8. UNIX and Linux Applications

diffrence between .cshrc .login .profile

Dear experts ... Please any one can describe the diffrence between this three 1) . cshrc 2) .profile 3) .login cheers syed (1 Reply)
Discussion started by: smuqtaderali
1 Replies

9. Shell Programming and Scripting

diffrence in non recusion and recursion

Hi, If i have given to write a prog for factorial in C using recursion and without recursion which one is better in what condition and why ? thanks (2 Replies)
Discussion started by: useless79
2 Replies

10. UNIX for Dummies Questions & Answers

How to find time

Help me with this please... If i am entering command ls -l, here is what it gives: -rw-r----- 1 user22 psa 2140 Dec 2 2005 summary.gz anyone knows how can i know the time it was last modified? (7 Replies)
Discussion started by: dakid
7 Replies
Login or Register to Ask a Question