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
how to print date using ftp commands kittusri9 Shell Programming and Scripting 3 05-07-2008 12:48 AM
Compare date from db2 table to yesterday's Unix system date sasaliasim Shell Programming and Scripting 8 04-24-2008 03:04 AM
Running UNIX commands remotely in Windows box from Unix box – avoid entering password D.kalpana UNIX for Dummies Questions & Answers 1 04-20-2007 02:24 AM
Changing Creation Date to a Prespecified Date of a File In Unix monkfan UNIX for Dummies Questions & Answers 4 11-28-2006 03:15 AM
Maingrame to UNIX sending UNIX commands skammer UNIX for Dummies Questions & Answers 2 06-27-2002 09:19 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-04-2007
Registered User
 

Join Date: Oct 2007
Posts: 2
unix sleep and date commands

please help me to fix my script trying to use sleep 2 minutes while the system is sleeping i want to print out same message every 5 seconds
thanks
t=`date +%S`

while [ t = t+120 ]
do
sleep 5

echo "this program will end in 2 minute"
done
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-04-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
I would use "bc" to do the calculation.

WAITSECS=`echo $WAITSECS - 5 | bc`
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:25 PM.


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

Content Relevant URLs by vBSEO 3.2.0