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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-19-2002
brv brv is offline
Registered User
  
 

Join Date: Feb 2002
Posts: 11
Time

I have a Solaris 2.6 machine and I execute the following:

while [ 1 ]
do
echo looping
sleep 15
done

I would assume the looping would be printed every 15 seconds but it doesn't. consecutive looping gets printed without a 15 second gap. Any idea what might be the reason ?

Thanks
  #2 (permalink)  
Old 02-19-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
I just tried this with ksh on Solaris 2.6 and I get a 15 second delay between each "looping". What shell are you using?

If you are using sh/ksh/bash, you are confusing yourself a little with the "while [ 1 ]" syntax. "while [ 0 ]" would also be an infinite loop. But this doesn't explain your result.
  #3 (permalink)  
Old 02-19-2002
brv brv is offline
Registered User
  
 

Join Date: Feb 2002
Posts: 11
I am using /bin/ksh
  #4 (permalink)  
Old 02-19-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
Your "sleep" command must be broken somehow. Put a "type sleep" as the first line of the script to see where it is. Does "sleep 15" work from the command line?
  #5 (permalink)  
Old 02-19-2002
brv brv is offline
Registered User
  
 

Join Date: Feb 2002
Posts: 11
sleep is in /usr/bin/sleep

There is also a sleep in /bin/sleep.

I tried /bin/sleep also. That also didn't work. Though if I do a sleep 150, it does sleep for a longer time(a little over a second) but definately not 150 seconds.
  #6 (permalink)  
Old 02-19-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
This is strange. Are you the sysadmin? It sounds like someone replaced the sleep command with one that works in tenths of a second instead of seconds. Does sleep 150 do the trick?

When I do a "cksum /usr/bin/cksum /usr/bin/sleep, I get:
1252908489 6844 /usr/bin/cksum
2990595405 4580 /usr/bin/sleep
What do you get?

Also, type "date", wait 15 seconds using a watch, then type "date" again. Did the system time advance by about 15 seconds?
  #7 (permalink)  
Old 02-19-2002
brv brv is offline
Registered User
  
 

Join Date: Feb 2002
Posts: 11
I did the cksum and I get the same results as yours.

Also, I did the date, waited 15 seconds and the time had advanced by exactly 15 seconds.

I have the root passwd.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0