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
Linux Going Big Time and Prime Time Against Windows, UNIX (WSJ) (Addict 3D) iBot UNIX and Linux RSS News 0 06-21-2007 01:10 PM
Start time/end time and status of crontab job thambi Shell Programming and Scripting 3 05-16-2007 07:24 AM
How To Provide Time Sync Using Nts-150 Time Server On Unix Network? pesty UNIX for Advanced & Expert Users 2 03-21-2007 11:20 PM
Differences between time command and usr/bin/time icedrake UNIX for Dummies Questions & Answers 1 04-24-2005 12:34 PM
default time in Solaris 8 for time-wait eloquent99 UNIX for Dummies Questions & Answers 1 04-01-2003 06:45 AM

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

Join Date: Apr 2005
Posts: 12
Regarding time

Hi,

How can I print the time in seconds(only). I have get the execution time of a script. Now I want the duration in seconds. How can I do it?

Thanks in advance
Reply With Quote
Forum Sponsor
  #2  
Old 04-04-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 383
With SECONDS variable.

Ex:

Code:
i=0
while [ $i -le 10 ]
do
  echo $SECONDS
  sleep 1
  (( i += 1 ))
done
Bye
Reply With Quote
  #3  
Old 04-04-2006
Registered User
 

Join Date: Apr 2005
Posts: 12
Hi,

Is there any command to display time in seconds.

Thanks in advance
Reply With Quote
  #4  
Old 04-04-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 383
SECONDS is a builtin varaible , it“s value is the number of seconds the script has been running.

Bye
Reply With Quote
  #5  
Old 04-04-2006
Registered User
 

Join Date: Apr 2005
Posts: 12
Hi,

Thank you. It works
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 10:55 PM.


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