The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing global variable to a function which is called by another function sars Shell Programming and Scripting 4 06-30-2008 08:39 AM
Function within function (Recurance) chassis UNIX for Dummies Questions & Answers 2 09-19-2006 06:32 AM
function mpang_ Shell Programming and Scripting 1 07-25-2006 09:16 PM
function rkkiran UNIX for Dummies Questions & Answers 3 01-22-2002 12:07 AM
How to convert the "select" function into a "poll" function rbolante High Level Programming 1 07-10-2001 07:49 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-09-2006
Registered User
 

Join Date: Jul 2006
Posts: 12
TimeDiff function?

Hi,
Is there any function in Unix that could get the Time Differrence of two values? this would be used as statistic for how long a job completes, from start to finish..

Please help.

thanks,
Jet
Reply With Quote
Forum Sponsor
  #2  
Old 08-09-2006
Registered User
 

Join Date: Aug 2006
Posts: 18
# time find / -name host*
....
....
....

real 0m12.63s
user 0m1.82s
sys 0m8.44s

#
Reply With Quote
  #3  
Old 08-09-2006
Registered User
 

Join Date: Jul 2006
Posts: 12
Thanks..
Could you explain what the code do?
Reply With Quote
  #4  
Old 08-10-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,297
time <some command> - does what you want, return elapsed times
find / -name 'host*' - searches for all filenames on the system that start with "host"
Reply With Quote
  #5  
Old 08-10-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
Is there any way to find a execution time of a shell script which have number of commands?
Reply With Quote
  #6  
Old 08-10-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 988
If you're asking what I think you are, it's time ./shell-script.sh

Or if you're asking for something that tells how many commands the shell script has executed, only the shell script knows.
Reply With Quote
  #7  
Old 08-10-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
Thanks for your reply. i know this time command but i need to make it in that shell script only.Like if shell script have n number of commands then need time as sum of time taken by all the commands.any help would be appreciated.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0