TIP: Click on subject to list as thread! ANSI
echo: batpower
to: All
from: Paul Quinn
date: 2005-08-10 18:55:10
subject: Wait looping in linux

Hi! All,

I'm really trying to 'stretch' for extra credit per the echo rules, with this one...

Currently, I'm attempting to polish off a linux bash script that just needs
a 'wait loop'.  Ordinarily I would do it in DOS like this:

  :: Wait for 2 minutes for all activity to cease...
  FOR %%A IN (X X) DO CHOICE /TY,60>NUL
  GOTO XITARGUS

What I have at present looks great but gives nothing like a 2 munute wait. 
In fact it's not even 2 seconds on the AMD-k6-2/500!  :)  It goes like this
at the moment:

  # Wait for 2 minutes for all activity to cease...
  while $(n <= 100000); do
    n=n+1
  done

Would any kind soul care to donate a better method, please?  Even just a 1
minute wait...?  :)

Cheers,
Paul.

... Some days it's just not worth chewing through the restraints.
--- GoldED+/LNX 1.1.4.7
* Origin: Quinn's Post - Maryborough, Qld, OZ (IP 1200-1500 UTC) (3:640/384)
SEEN-BY: 633/267 270
@PATH: 640/384 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.