Link to home
Start Free TrialLog in
Avatar of zulliger
zulliger

asked on

how to program a delay in a bash-script

i've got a little script to connect my pc to the internet. due to I'm using ip-masquerading, I have to run a script for the ipchains-rules. my problem: when I run this script which sets the rules for ipchains just after I gave the command to connect to my isp, I have no IP-adress. so i have to run this script for a second time, after about 3 seconds (I'm using ISDN). now I wanna ask, if there is a bash "delay"-command. It have not to be exactly. about 3 or 5 seconds on a pentium 100.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of modulus
modulus

#!/bin/bash
echo "Now";
command sleep 10;
echo "Then";

Can do seconds, minutes, hours.  Default units are seconds.

Best wishes,
modulus
Guess ozo got there first!

m.
Avatar of zulliger

ASKER

thank you very much! (I hope it will work, because I havent't tried it yet...)