The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh script using expr to calculate percentages wurzul Shell Programming and Scripting 6 05-01-2008 03:19 AM
calculate time itik AIX 2 02-14-2008 11:08 PM
how to calculate CPU time under HP-UX limame HP-UX 1 06-18-2007 02:28 PM
calculate the time differnce between two given timings Olti UNIX for Dummies Questions & Answers 1 01-05-2006 10:22 AM
Calculate Elapsed Time sysera Shell Programming and Scripting 5 06-16-2004 10:10 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 10-02-2001
sanjay92
Guest
 

Posts: n/a
Thanks Perderabo,
It looks like timex command is not installed because I don't see in /usr/bin;/usr/local/bin etc.
Question about SECONDS variable in ksh : when I do
$echo $SECONDS
I donot see the no. of seconds past mid night. What I see a very low value which does not seems that it is no. of seconds after mid night. Can you please confirm.

Thanks

Sanjay
Forum Sponsor
  #9  
Old 10-02-2001
sanjay92
Guest
 

Posts: n/a
Perderabo,
Here is the man page of ksh which describes it like this.

SECONDS Each time this variable is referenced, the
number of seconds since shell invocation is
returned. If this variable is assigned a
value, then the value returned upon reference
will be the value that was assigned plus the
number of seconds since the assignment.

Thanks for your suggestion. It looks like SECONDS is what I was looking for.
  #10  
Old 10-02-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,614
Quote:
Originally posted by sanjay92

Question about SECONDS variable in ksh : when I do
$echo $SECONDS
I donot see the no. of seconds past mid night. What I see a very low value which does not seems that it is no. of seconds after mid night. Can you please confirm.
You're right. It's seconds since shell was started. But if you set it, it starts counting from where you set it. In my .env file I have:
((SECONDS = $(date "+3600*%H+60*%M+%S") ))

and, gosh, I just figured that everyone does that!

Seriously, I did that so long ago that I forgot.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:11 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